Trying to vertically align text within a div by adjusting line height to match div height has been successful with just text or small images. However, when larger images are added to the div, it causes the text to be pushed downward for some reason. Take a look at this fiddle that demonstrates the issue.
The fiddle contains 4 divs each set with height: 40px
and line-height: 40px
. The difference among them is that the 2nd, 3rd & 4th divs include images of varying sizes - small, medium, and large:
.small{height:20px;}
.medium{height:30px;}
.large{height:40px;}
What is causing the alignment problem with the third and fourth images?