Previous Message
Next Message

Centering Floated Images

Sent by Gunlaug_Sørtun on 29 September 2005 19:07

Matt Harris wrote:
> I have a group of floated images which wrap to the next line as the 
> page width changes. Inevitably, a few stranglers will be on the 
> bottom row, and of course, they will be floated left. Is there a way 
> to center these images and achieve the same wrapping effect?

Don't float those images...

Something like:

<style type="text/css">
..images {width: 99%/* not always needed */; text-align: center;}
..images img {border: solid 1px #bbb; margin: 3px;}

<div class="images">
<a href="#"><img src="1.jpg" alt="" id="a1" /></a>
<a href="#"><img src="2.jpg" alt="" id="a2" /></a>
<a href="#"><img src="12.jpg" alt="" id="a12" /></a>

....should do just fine. At least it does at my end :-)

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: