Quote:
Originally Posted by GeoffR
The difference between line-height: 1.2; and line-height: 1.2em; is that when inherited, the unitless version will apply to the font size of the inheriting element, while 1.2em will be based on the font size of the original element.
e.g.
Code:
stylesheet:
div.em-units { font-size: 1em; line-height: 1.2em; }
div.unitless { font-size: 1em; line-height: 1.2; }
p { font-size: 0.5em; }
html:
<div class="em-units">
<p>This text has line height 2.4 times its font size.</p>
</div>
<div class="unitless">
<p>This text has line height 1.2 times its font size.</p>
</div>
|
This is correct. That's why I posted the links and why I said that 1.2 is the standard way to code line-height.