An inline-block
span element with a line-height
of 20.16px (14.4pt font-size
* 1.4 line-height
) has a height
of 19px on Chrome.
An inline-block
span element with a line-height
of 20.16px (20.16px line-height
) has a height
of 20px on Chrome.
The element inspector gives an identical line-height
for both elements, but explicitly setting the line-height
changes the element's height. Try the fiddle to see what's happening:
span {
font-size: 14.4px;
line-height: 1.4;
/* line-height = 20.16px; 14.4 * 1.4 */
display: inline-block;
}
span.explicit {
line-height: 20.16px;
}
<span>line-height of 20.16px has a height of 19px!!</span>
<br />
<span class="explicit">line-height of 20.16px has a height of 20px</span>
<br />
<br />
<strong>Use inspect element to examine the two span's differing height</strong>
Question is: Why is this happening?