Solved

spacing (fit exactly 704 width)

Posted on 2011-09-12
4
161 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

685 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