In IE 6 and, in some cases, IE 7, inline images will cause the line that they’re on to disregard any custom line height:
This demo will describe a bug where the line-height is incorrectly rendered if the line contains a replaced element. Very simply, if the default line-height is changed to a larger value, the line spacing above and below any text line that contains a replaced element, such as a small emoticon, will be half of the spacing seen elsewhere in the text.
Jeroen Mulder, Line-height / Replaced Element Bug
WorkaroundIf your desired line height is larger than the normal, Bruno Fassino
recommends using nearly-invisible spacer images to push the line height around the image back up to what you want.
Unfortunately,
this solution does not work if you want the line height to be smaller than normal (see Fassino’s
small images test). In those cases, your only recourse is to fake an inline image with a background on another element (such as a
<span>) or take the image out of the flow somehow.
Use of a
<span> with padding is unfortunately compromised in bi-directional text, as both IE and FF cannot handle padding correctly in those cases. (I hope to get to this topic in an upcoming Fun Fact.)