Sub topic 6
Choosing a leading value
This chapter assumes you know what font size and line length are, and that you can read basic CSS. Leading (pronounced "ledding") is the vertical distance from one line's baseline to the next. Here you will learn how to pick a value for it.
Think in ratios, not points
Designers once measured leading in points. A 10 pt font with 12 pt leading was written "10/12". Today it is easier to express leading as a ratio of the font size:
leading ratio = line spacing ÷ font size
A 16 px font with 24 px between baselines has a ratio of 24 ÷ 16 = 1.5. A ratio keeps working when the font size changes, and it is the same form CSS uses for a unitless line-height.
Typical ranges
These are commonly cited starting points, not laws.
| Text | Typical ratio | Why |
|---|---|---|
| Body text, 60–75 character lines | 1.4 to 1.6 | Space between lines helps the eye find the start of the next line |
| Narrow text such as captions | 1.3 to 1.45 | Short lines make the return sweep short, so less space is needed |
| Large headings | 1.1 to 1.3 | Large type looks looser, so the gaps need to shrink |
| Very long lines | 1.6 or more | The eye has farther to travel back, so it needs more help |
For most body text, 1.5 is a sound default. WCAG 2.1 success criterion 1.4.12 uses 1.5 as its line-spacing test value, which makes it a convenient reference point.
What goes wrong at each extreme
- Too tight (below about 1.2 for body text). Descenders of one line (the parts of letters like g and y that drop below the baseline) nearly touch the ascenders of the next (the parts of letters like d and l that rise above the x-height). The text looks dense and the eye can slip onto the wrong line.
- Too loose (above about 1.8 for body text). The lines stop looking like one block. Each line reads as a separate strip, and the reader loses the sense of a paragraph.
A quick way to choose
Two later chapters explain the adjustments in this diagram. "Longer lines need more leading" covers how measure affects leading. "Why the typeface changes the answer" covers how letterforms such as a tall x-height affect it. For now, treat 1.5 as the baseline and move away from it for a reason.
Setting it in CSS
Write the value as a bare number with no unit:
body {
font-size: 1rem;
line-height: 1.5;
}
h1 {
font-size: 2.5rem;
line-height: 1.2;
}The body text gets 1.5 × 16 px = 24 px of line height. The heading gets 1.2 × 40 px = 48 px, so it is tighter than the body text even though its lines are taller in absolute terms.
Common mistakes
- Setting one
line-heightin pixels and never revisiting it when the font size changes. - Using the same ratio for headings and body text.
- Choosing a value without looking at the rendered text. Numbers get you close, and your eye makes the final decision.
Exercise
A paragraph has a font size of 18 px and 27 px between baselines. What is its leading ratio, and how would you write it in CSS? Why is a unitless value safer than 27px for a page where headings share the same parent?
Show answer
The ratio is 27 ÷ 18 = 1.5, written as line-height: 1.5;. A unitless value is inherited as a ratio, so a heading with a 40 px font size gets 60 px of line height. A fixed 27px would be inherited by the heading as-is, which is too small for its size and makes its lines overlap.