Solved

spacing (fit exactly 704 width)

Posted on 2011-09-12
4
163 Views
Last Modified: 2012-05-12
this code provides
2 rows
4 pictures each


I want each row to be 704 width

and have spacing
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style> 
#product {
float:left;
behavior: url(border-radius.htc);
margin:5px 5px;
border-radius: 5px 15px 15px 15px;
-moz-border-radius:5px 15px 15px 15px;
-webkit-border-radius:5px 15px 15px 15px;
border:1px solid #999;
background: white;
width:140px;
height:190px;
}

#product .title{
  color:#06C;
  font-weight:bold;
  text-align:center;
  margin:3px;
}
#product img{
  margin:5px 15%;
}
#product .price{
  text-align:center;
  margin-top:10px;
  color:#06C;  
}
#wrap {width: 610px; margin: 0 auto;}
</style>

</head>

<body>
<div id="wrap">
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
</div>

</body>
</html>

Open in new window

0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 167 total points
ID: 36527021
Try using this one
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style> 
#product {
float:left;
behavior: url(border-radius.htc);
margin:7px;
border-radius: 5px 15px 15px 15px;
-moz-border-radius:5px 15px 15px 15px;
-webkit-border-radius:5px 15px 15px 15px;
border:1px solid #999;
background: white;
width:160px;
height:190px;
}

#product .title{
  color:#06C;
  font-weight:bold;
  text-align:center;
  margin:3px;
}
#product img{
  margin:5px 15%;
}
#product .price{
  text-align:center;
  margin-top:10px;
  color:#06C;  
}
#wrap {width: 704px; margin: 0 auto; padding:4px;}
.clear{clear:both;}
</style>

</head>

<body>
<div id="wrap">
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div class="clear"></div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
</div>

</body>
</html>

Open in new window

0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 167 total points
ID: 36527263
check this code too
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Untitled Document</title>
		<style> 
			.product {
			float:left;
			behavior: url(border-radius.htc);
			margin:5px 5px;
			margin-right:9px;
			border-radius: 5px 15px 15px 15px;
			-moz-border-radius:5px 15px 15px 15px;
			-webkit-border-radius:5px 15px 15px 15px;
			border:1px solid #999;
			background: white;
			width:160px;
			height:190px;
			}

			.product .title{
			  color:#06C;
			  font-weight:bold;
			  text-align:center;
			  margin:3px;
			}
			.product img{
			  margin:5px 15%;
			}
			.product .price{
			  text-align:center;
			  margin-top:10px;
			  color:#06C;  
			}
			#wrap {width: 704px; margin: 0 auto;}
			.row {width: 704px; margin: 0 auto;}
		</style>

	</head>

	<body>
		<div id="wrap">
			<div class="row">
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
			</div>
			<div class="row">
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
				<div class="product">
				  <div class="title">Camera</div>
				  <img src="canon-550d.gif" alt="Camera" />
				  <div class="price">$300</div>
				</div>
			</div>
		</div>

	</body>
</html>

Open in new window

0
 
LVL 16

Assisted Solution

by:SSupreme
SSupreme earned 166 total points
ID: 36529923
My method doesn't involve html editing only css editing.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style> 
#product {
float:left;
behavior: url(border-radius.htc);
margin:5px 17px;
border-radius: 5px 15px 15px 15px;
-moz-border-radius:5px 15px 15px 15px;
-webkit-border-radius:5px 15px 15px 15px;
border:1px solid #999;
background: white;
width:140px;
height:190px;
}

#product .title{
  color:#06C;
  font-weight:bold;
  text-align:center;
  margin:3px;
}
#product img{
  margin:5px 15%;
}
#product .price{
  text-align:center;
  margin-top:10px;
  color:#06C;  
}
#wrap {width: 704px; margin: 0 auto;}
</style>

</head>

<body>
<div id="wrap">
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
<div id="product">
  <div class="title">Camera</div>
  <img src="canon-550d.gif" alt="Camera" />
  <div class="price">$300</div>
</div>
</div>

</body>
</html>

Open in new window

0
 

Author Closing Comment

by:rgb192
ID: 36554484
all work, thanks
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Page Speed Insight with srcset 4 202
Hiding Adsense on Mobile Devices 2 72
bootstrap form validations! 1 36
CSS Odd/Even Confusion 2 36
Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question