Sub topic 6
Choosing a Leading Value
This chapter assumes you know what leading and measure are, and that you can read basic CSS. Its job is narrower: how to pick a leading number for a block of body text, and how to know when the number is wrong.
Leading as a ratio
Leading is the distance from one baseline to the next. Designers once measured it in points, as in "10 on 12" (10 pt type, 12 pt leading). For screens, a ratio is more useful, because it keeps working when the font size changes.
The ratio is leading divided by font size:
- 16 px text with 24 px leading gives 24 / 16 = 1.5.
- 10 pt text on 12 pt leading gives 12 / 10 = 1.2.
- 18 px text with 27 px leading gives 27 / 18 = 1.5.
The last two lines show why the ratio helps. The 16 px and 18 px examples have different pixel values and the same ratio. If you think in ratios, you describe the relationship once and it holds at any size.
Common starting values
Most advice for continuous body text lands in a band around 1.4 to 1.6 times the font size. Treat these numbers as starting points to test by eye, because they are conventions and not laws.
| Ratio | Typical use | Effect |
|---|---|---|
| 1.0 to 1.15 | Large display headings, short labels | Lines nearly touch. Fine for one or two lines, tiring for paragraphs. |
| 1.2 to 1.3 | Large headings that wrap, tight captions | Compact. Needs short lines. |
| 1.4 to 1.5 | Body text at a moderate measure | The common default for web text. |
| 1.5 to 1.7 | Body text with long lines, or with a large x-height | Airy. Helps the eye return to the correct line. |
| 1.8 and above | Rare. Large intro text or very wide lines | Lines begin to read as separate strips instead of a paragraph. |
WCAG 2.1 success criterion 1.4.12 (Text Spacing) uses 1.5 as its reference value for line height. A body default of 1.5 therefore meets that reference before you do anything else. The criterion itself is covered in a later chapter.
Why too little and too much both hurt
Reading is a sequence of short eye jumps along a line, followed by a longer jump back to the start of the next line. The return jump is where leading matters.
- Too tight. Descenders of one line (the tails of g, p, y) and ascenders of the next line (the tops of b, d, l) crowd each other. The line below competes with the line you are reading. The eye can slip to the wrong line on the return jump, and the page looks dense and gray.
- Too loose. The lines stop reading as one block. Each line becomes a separate stripe, and the eye has to travel farther to reach the next line. Large gaps also make the paragraph look like a list.
You are aiming for the range where the white space between lines is clearly visible but smaller than the lines' own visual weight.
A working procedure
Use the same steps each time. This keeps you from guessing.
- Fix the font size first. Leading is a ratio of it, so it must be settled.
- Fix the measure, or at least the range it will fall in. Leading depends on line length.
- Start with 1.5.
- Adjust for line length. Longer lines get more leading, shorter lines get less.
- Adjust for the typeface. Large x-height, wide letterforms, or a heavy weight call for more leading.
- Render a real paragraph, not placeholder lines of "lorem ipsum" copy that you have not read. Look at it from a normal reading distance.
body {
font-size: 1rem;
line-height: 1.5;
}
.article p {
max-width: 70ch;
line-height: 1.6;
}
.caption {
max-width: 45ch;
line-height: 1.4;
}The body default is 1.5. The article paragraphs have a wider measure, so they get 1.6. The captions are narrow, so they get 1.4. Each value is a small adjustment from the default and not a different system.
Adjusting for the typeface
Two fonts at the same font size can need different leading, because font size does not measure how big the letters look.
- x-height. This is the height of lowercase letters like x, a, and e, relative to the font size. A font with a large x-height fills more of each line box, so the gap between lines shrinks. It usually needs a little more leading.
- Letter width and weight. Wide or bold letterforms make lines look denser. A little more leading offsets that.
- Ascender and descender length. Long ascenders and descenders reach into the space between lines. Fonts with short ones can take a bit less.
- Contrast and detail. Fonts with very thin strokes or heavy contrast can look uneven at tight leading.
The effect is a nudge of about 0.05 to 0.1 on the ratio, not a jump. If you swap one body font for another and the paragraph suddenly looks denser, change the ratio before you change anything else.
Leading does not always stay constant
A single value rarely fits a whole page. Headings, body text, and captions have different sizes and line lengths.
- Headings. A large heading that wraps over two or three lines needs a smaller ratio than body text. At 2.5 rem, a ratio of 1.5 leaves a very large gap. A value of 1.1 to 1.25 is common.
- Small text. Footnotes and captions at small sizes often need slightly more leading than their size suggests, because tiny text is harder to track. Keep the measure short to compensate.
- Single lines. Leading has no visible effect on a one-line element, but it still sets the height of the line box, which matters for buttons and labels.
h1,
h2,
h3 {
line-height: 1.2;
}
p {
line-height: 1.5;
}
small,
.footnote {
line-height: 1.5;
}Common mistakes
- Using a length instead of a ratio.
line-height: 24pxon the body is inherited as 24 px by every child. A heading at 40 px then gets 24 px lines and the lines overlap. A unitless number is inherited as a ratio and recalculated for each element. - Setting
line-heighton a container and a size on a child. With a unitless value, the child recalculates correctly. Withemor%, the computed length is inherited, not the ratio. - Tuning leading before the measure. If the line is 110 characters long, no leading value rescues it. Shorten the line first.
- Judging with placeholder text. Real text has real word lengths and ascenders. Check with the actual copy.
- Fixing a cramped look with letter-spacing. Tracking changes horizontal density. It does not fix vertical crowding.
/* Problem: the length is inherited as 24px by every child */
.broken {
font-size: 16px;
line-height: 24px;
}
.broken h1 {
font-size: 40px; /* lines are only 24px apart and overlap */
}
/* Fix: a unitless ratio is recalculated for each element */
.fixed {
font-size: 16px;
line-height: 1.5;
}
.fixed h1 {
font-size: 40px; /* line height becomes 60px, then override to 1.2 for headings */
line-height: 1.2;
}Quick reference
These adjustments are conventions drawn from common typographic practice. They give you a good first draft, and the final check is always visual.
Exercise
A body paragraph uses 18 px text with 1.5 line-height. The measure is about 80 characters and the typeface has a large x-height. Give the leading in pixels for the starting value, and name a reasonable adjusted ratio with your reasons.
Show answer
The starting leading is 18 × 1.5 = 27 px. The line is long (about 80 characters), so the eye needs more help on the return jump, which suggests adding about 0.1 and moving toward 1.6. The large x-height fills more of each line and narrows the visible gap, so a further nudge of 0.05 to 0.1 is reasonable, giving roughly 1.65 to 1.7. At 1.65 the leading is about 29.7 px. The better fix is also to shorten the measure toward 65 to 70 characters, which would let you return to about 1.5 to 1.55.
Exercise
A stylesheet sets body { font-size: 16px; line-height: 24px; }. An h1 inside it has font-size: 40px and wraps to two lines, and the lines overlap. Why does this happen, and how do you fix it?
Show answer
A length value is inherited as that exact length, so the h1 gets 24 px between baselines even though its text is 40 px tall. Replace it with a unitless ratio such as line-height: 1.5 on body, which each element recalculates from its own font size, and set h1 { line-height: 1.2; } so the heading is tighter than body text.