?
Solved

spacing (fit exactly 704 width)

Posted on 2011-09-12
4
Medium Priority
?
167 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 668 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 668 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 664 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

770 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