http://jsfiddle.net/xJmZt/
As you can see in the above example , there is extra height of about 6px on the div
.
That ex开发者_开发百科tra height is gone if line-height is changed to ~1px (link).
So line-height affects images too ?
Images by default are defined as inline elements so they follow text rules, you can either set the container height to match the images', or give the image display: block
or vertical-align: bottom
.
精彩评论