Imagine this scenario: (see live demo here)
Snippet of HTML code:
<a><img src="http://img.brothersoft.com/icon/softimage/s/smiley.s_challenge-131939.jpeg" /></a>
CSS styles applied:
a {
display: block;
background: #000;
line-height: 40px;
}
img {
vertical-align: middle;
}
The result displayed is:
Why does the image appear off-center vertically?
Is there a way to correct this so it looks consistent across all major browsers?
Please consider that the actual image size may vary and is not fixed (such as 32x32 in this specific case).