Sub topic 5
Leading: the space between lines
This chapter assumes you know what font size means and can read basic CSS. You do not need to know how to set line length yet. That comes in a later chapter.
What leading is
Leading (pronounced "ledding") is the vertical distance from one line's baseline to the next line's baseline. The name comes from metal printing, where strips of lead were placed between rows of type. On the web, the CSS property for this is line-height.
Leading is not the gap between lines alone. It is the full line pitch, which includes the height of the text itself. A 16px font with 24px of leading has a line pitch of 24px, and the visible gap between lines is only a part of that.
Why leading affects reading
When you finish a line, your eye must jump back to the left edge and land on the start of the next line. Leading controls how easy that landing is.
- Too tight: descenders of one line (the tails on g, p, y) nearly touch the ascenders of the next line (the tops of b, d, l). Lines blur together, and the eye can slip to the wrong line.
- Too loose: lines look like separate strips instead of one block. The eye has to travel farther, and the paragraph loses its shape.
- Well chosen: the lines form an even gray block, and the eye moves down it without effort.
Choosing a leading value
Express leading as a ratio of font size. A ratio carries over when the size changes, while a fixed pixel value does not.
A common starting point for body text is 1.4 to 1.6 times the font size. Many sources cite 1.5 as a safe default. The ratio comes from the font size, not from the browser's default. Browsers often use normal, which is about 1.2 for many fonts and is usually too tight for paragraphs.
| Text kind | Typical ratio | Why |
|---|---|---|
| Body paragraphs | 1.4 to 1.6 | Comfortable for sustained reading |
| Short captions | 1.3 to 1.4 | Few lines, so less return distance |
| Large headings | 1.1 to 1.25 | Big type already looks spaced out |
| Long lines | Toward 1.6 or more | The eye needs more help finding the next line |
Treat these as starting points. Your eye makes the final decision.
Setting leading in CSS
Use a unitless number. It multiplies each element's own font size, so a heading and a paragraph each get leading that fits them.
body {
font-size: 1rem;
line-height: 1.5;
}
h1 {
font-size: 2.5rem;
line-height: 1.2;
}With 1rem at 16px, the body line pitch is 24px. The heading is 40px, so its line pitch is 48px.
Why not use a length or percentage
A value such as line-height: 150% or line-height: 1.5em is calculated once, on the element where it is set. Children then inherit the computed pixel result, not the ratio. A child with a larger font size keeps the parent's smaller line pitch and its lines can crowd together.
.bad {
font-size: 1rem;
line-height: 150%;
}
.bad small-print {
font-size: 2rem;
}
.good {
font-size: 1rem;
line-height: 1.5;
}In the .bad case, a descendant at 2rem would inherit 24px of line pitch, not 48px. In the .good case, a descendant at 2rem gets 48px, because the ratio is inherited, not the pixel value.
Common errors
- Setting a fixed pixel
line-heightonbodyand forgetting that headings inherit it. - Leaving the browser default
normalon long paragraphs. - Using the same ratio for every size. Large text usually needs a smaller ratio.
- Changing the font size but not checking the leading again.
Exercise
A paragraph has font-size: 1.125rem and a line-height of 1.5. Assume 1rem is 16px. What is the line pitch in pixels, and why is 1.5 better than 27px?
Show answer
1.125rem is 18px, and 18 × 1.5 = 27px. The unitless 1.5 is inherited as a ratio, so any child element with a different font size gets a line pitch that fits its own size. A fixed 27px would be inherited as 27px by every child and could be too tight or too loose.