Take a look at this code and test it: you can do the same in a more efficient, semantic and cleaner way:
Css:
div.imageBox {
float: left;
margin-right: 10px;
}
div.imageBox p {
text-align: center;
}
Html:
<div class="imageBox">
<a href="#">
<img src="image1.gif" width="100" height="100"
alt="image 1" /></a>
<p><a href="#">1</a></p>
</div>
<div class="imageBox">
<a href="#">
<img src="image2.gif" width="100" height="100"
alt="image 1" /></a>
<p><a href="#">2</a></p>
</div>
<div class="imageBox">
<a href="#">
<img src="image3.gif" width="100" height="100"
alt="image 1" /></a>
<p><a href="#">3</a></p>
</div>
That's all you need!
If you want to keep your code there is no reason to use attribute alignment inside the img tag. You can use span instead of div, but in this case it is better to use divs and give them width:
div#Pictures div
{
float: left;
margin-right: 5px;
}
This code:
a:links2
doesn't make sense. links2 is a class made by you, not a pseudo class or pseudo element.
source
to share