Sub topic 8
Line Height for Readable Paragraphs
This chapter assumes you know the basic vocabulary of type (typeface, font size, weight) and can read simple CSS. It covers line height, also called leading, and how it supports the hierarchy you have built so far.
What line height does
Line height is the distance from one baseline to the next in a block of text. Designers also call it leading, a term from metal type, where strips of lead were placed between lines. Line height controls how much white space surrounds each line.
Readers move from the end of one line to the start of the next. If lines sit too close together, the eye can land on the wrong line. If they sit too far apart, the lines stop reading as one paragraph. Good leading keeps the paragraph a single, even block of gray.
Setting body text
For body text, a line height of about 1.4 to 1.6 times the font size works well. The usual starting point is 1.5.
body {
font-family: Georgia, serif;
font-size: 1rem;
line-height: 1.5;
}
p {
max-width: 65ch;
}Write line height as a unitless number. A unitless value is multiplied by each element's own font size. A value such as 1.5em or 24px is calculated once and then inherited as a fixed length. Child elements with larger type would then get lines that are too tight.
Leading depends on three things:
- Line length. Longer lines need more leading so the eye can find the next line. Shorter lines can use less.
- Typeface. Fonts with a large x-height (tall lowercase letters) or wide letterforms need more space.
- Size. Small text usually needs proportionally more leading than large text.
Tightening leading for headlines
Headlines are larger and usually span only one to three lines. At a 1.5 ratio, the gaps between those lines look loose, and the headline falls apart into separate lines. Reduce the ratio as size increases.
h1 {
font-size: 2.441rem;
line-height: 1.15;
font-weight: 700;
}A rough guide follows.
| Text | Typical line height |
|---|---|
| Body paragraphs | 1.4 to 1.6 |
| Subheads | 1.25 to 1.35 |
| Large headlines | 1.1 to 1.2 |
This difference is a hierarchy cue in itself. Tight, heavy headlines look like one unit. Open, even body text looks like something to read at length.
Common errors
- Using a fixed unit.
line-height: 24pxonbodybreaks when a child element has a larger font size. Use a unitless number. - One value everywhere. Applying 1.5 to headlines makes them look loose. Set a separate value for each level.
- Too tight in paragraphs. Ratios near 1.2 make dense text tiring to read.
- Too loose. Ratios above about 1.8 make paragraphs look like lists of separate lines.
- Ignoring the measure. Changing line length without rechecking leading leaves the two out of balance.
Connecting to the rest of the hierarchy
Leading works with the other cues in this tutorial. A type scale sets sizes, and leading adjusts the vertical rhythm around them. Spacing between headings and paragraphs, covered next, builds on the line height you choose here. Many designers express margins as multiples of the body line height so that the vertical rhythm holds together.
Exercise
A page sets body { line-height: 24px; font-size: 1rem; }. A callout inside it uses font-size: 1.5rem, and its lines look cramped. What is the cause, and what is the fix?
Show answer
A fixed length such as 24px is inherited as that exact value, so the 1.5rem text keeps a 24px line height, which is only about 1 times its size. Change the body rule to a unitless value such as line-height: 1.5. Each element then multiplies the number by its own font size, so the callout gets 36px lines at 24px type. For a large headline, also set a tighter value such as 1.15.
Exercise
Why should a headline use a smaller line-height ratio than body text?
Show answer
A headline is large and short. At a body ratio of 1.5, the gap between its lines is large in absolute terms, so the lines look disconnected. A ratio of about 1.1 to 1.2 keeps the lines together as one unit.