View Single Post
Old 02-10-2018, 10:13 PM   #15
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Originally Posted by GeoffR View Post
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.
deback is offline   Reply With Quote