Log in

View Full Version : css li for 5 images in a row



acctman
02-26-2009, 04:47 PM
I need to put 5 images in a row, can some give me an example or a generator site that will create the css code.

thanks

Snookerman
02-26-2009, 05:09 PM
Images are inline elements so they will align in a row by default. If I didn't understand your request, please try to be more clear about it.

X96 Web Design
03-01-2009, 03:07 AM
Snookerman's plan would work, or use this more complicated way:

CSS:


.floating-img {
float:left;
}
.clear-left {
clear:left;
}


HTML:


<img src="some-img.jpg" alt="" class="floating-img" />
<img src="some-img.jpg" alt="" class="floating-img" />
<img src="some-img.jpg" alt="" class="floating-img" />
<img src="some-img.jpg" alt="" class="floating-img" />
<img src="some-img.jpg" alt="" class="floating-img" />
<div class="clear-left"> </div>

The "clear-left" is to stop other items from wrapping around it (if you didn't already know).

Hope that helps!