Reputation: 59069
I'm coding it
<div>
<a href="http://example1.com">
<img src="example1.gif" />
</a>
</div>
<div>
<a href="http://example2.com">
<img src="example2.gif" />
</a>
</div>
a {
text-align:center;
height :80px;
display:block;
}
The centering of the horizontal direction do well. but vertical is not. How to do it? By the way, the height of example2.gif is different from example1.gif
Upvotes: 0
Views: 7166
Reputation: 4360
You will want to set vertical-align: middle;
on your img
elements.
Upvotes: 1