If paragraph lines feel cramped, check line-height alongside font-size and line length. A unitless line-height multiplies the element’s font size: at 20px, a value of 1.4 gives 28px of line height. For body text, a practical starting point is around 1.4–1.5. section 8.1 section 8.1.1
Inheritance can change the result. A parent with font-size: 20px and line-height: 150% computes a 30px line height; a child with font-size: 16px inherits that 30px value. Change the parent to line-height: 1.5, and the child inherits the multiplier instead, computing its own line height as 16 × 1.5 = 24px. Use a unitless value when descendants should retain the same proportion. section 3.4.6 section 3.1.3
.parent {
font-size: 20px;
line-height: 1.5; #1
}
.child {
font-size: 16px;
}
Compare the unitless parent declaration with the child’s different font size; the inherited multiplier produces a 24px line height. section 3.4.6
Line-height also works with font-size and max-width to shape readable paragraphs. In one scaling scheme, start with a 16px font, a 1.45 line-height, and a 480px maximum width. For a chosen font size in pixels, calculate line-height as 1.45 − (font size − 16) / 100. A 24px font therefore gets 1.37; the paired maximum width is 720px. Keep CSS custom-property inputs unitless for the calculation, adding px where a length is needed. section 8.1.2
Table 8.1 Calculated line heights and maximum widths based on different font sizes
| Font size |
Calculated line height |
Calculated maximum width |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Check the paired font sizes, line heights, and maximum widths produced by that scaling scheme. section 8.1.2
Repair a cramped article
An article with 16px text, a 1.2 line-height, and unrestricted line length is difficult to read. Choosing 20px text, a 1.41 line-height, and a 600px maximum width addresses all three problems together. section 8.1.5







