Previous Message
Next Message

Centering Floated Images

Sent by Gunlaug_Sørtun on 29 September 2005 18:06


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;}
</style>

<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>
</div>

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

regards
	Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: