Forum Moderators: not2easy
I have the following code that displays some images next to each other in a neat row. I want the images themselves to be centrally aligned in this row (at the moment they are left aligned).
Ive tried putting them in a <div>, <p>, margin-left:auto etc, and it either seems to not work or not validate. Ive searched loads and see this is a popular topic, but still cant get an answer.
So whats the correct way to align the images in code below (in XHML 1.0 Strict)?
<ul class="images">
<li><a href="#"><img src="img/products/small1.png" alt="example image" class="thumb" /></a></li>
<li><a href="#"><img src="img/products/small2.png" alt="example image" class="thumb" /></a></li>
<li><a href="#"><img src="img/products/small3.png" alt="example image" class="thumb" /></a></li>
<li><a href="#"><img src="img/products/small4.png" alt="example image" class="thumb" /></a></li>
</ul>
Thanks for any help
Alternatively see SuzyUK's port on display-inline being usable cross browser now and use text-align:center on the parent.