PDA

View Full Version : trying to get a second row of this image gallery


silverglade
01-16-2009, 05:12 PM
hi, im trying to get a second row of this image gallery, i tried using the <p> tag to separate the divs, but it didnt work. any help greatly appreciated. the code below is for one row only of images. id like two.

here is the css/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<html>
<head>
<style type="text/css">
div.img
{
margin: 2px;
border: 1px solid #0000ff;
height: auto;
width: auto;
float: left;
text-align: center;
}
div.img img
{
display: inline;
margin: 3px;
border: 1px solid #ffffff;
}
div.img a:hover img
{
border: 1px solid #0000ff;
}
div.desc
{
text-align: center;
font-weight: normal;
width: 120px;
margin: 2px;
}
</style>
</head>
<body>

<div class="img">
<a target="_blank" href="flower1.html">
<img src="product1_9385.jpg" alt="Klematis" width="110"
height="90" />
</a>
<div class="desc">Add a description of the image here</div>
</div>

<div class="img">
<a target="_blank" href="klematis2_big.htm">
<img src="klematis2_small.jpg" alt="Klematis" width="110"
height="90" />
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="klematis3_big.htm">
<img src="klematis3_small.jpg" alt="Klematis" width="110"
height="90" />
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="klematis4_big.htm">
<img src="klematis4_small.jpg" alt="Klematis" width="110"
height="90" />
</a>
<div class="desc">Add a description of the image here</div>
</div>

</body>
</html>

domedia
01-16-2009, 07:08 PM
It's going to wrap automatically once the horizontal width is reached.
If you need to control the width of the gallery further, wrap the image gallery in a DIV with a set width.