3.18 line-height Property
We mentioned the line-height property in the previous Font Properties section as part of our discussion of the font shorthand property. We postponed our discussion of the line-height property until now because, although it can be part of a font shorthand property’s value, it’s not really a font property. It’s used to specify the vertical separation between each line of text in an element. For example, in FIGURE 3.17, note the sentence1 CSS rule with line-height: 2em. That rule causes its matching element to display its lines with a vertical separation equal to twice the height of a normal character (remember, an em unit represents the height of a normal character). Note the resulting double-spaced line heights in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access