Sub topic 5
Leading: the space between lines
This chapter assumes you know what a font size is and can read basic CSS. It defines leading, shows how to measure and write it, and covers the mistakes that make a paragraph feel cramped or loose. The next chapter covers which values to choose.
What leading is
Leading is the vertical distance from one line of text to the next. It controls how much white space separates the lines of a paragraph. Readers rarely notice good leading, but they notice bad leading quickly.
The word comes from letterpress printing. Typesetters placed thin strips of lead between rows of metal type to push the lines apart. Without strips, the lines were "set solid". More strips meant more space. The term is pronounced "ledding", after the metal.
Leading is a different setting from type size. Type size sets how big each character is. Leading sets how far apart the lines sit. You can change one without the other, and readability depends on how the two relate.
Measuring leading: baseline to baseline
Leading is measured from the baseline of one line to the baseline of the next. The baseline is the invisible line the letters sit on. Letters like "p" and "g" hang below it.
Measuring baseline to baseline gives the whole distance between lines, not only the empty gap. Suppose type is 16 pixels (px) and the baselines are 24 px apart. The leading is 24 px, even though the visible gap between the bottom of one line and the top of the next is smaller.
Print designers write this as two numbers separated by a slash: type size, then leading.
| Notation | Read as | Meaning | Ratio of leading to size |
|---|---|---|---|
| 10/10 | ten on ten | 10 pt type, 10 pt leading (set solid) | 1.0 |
| 10/12 | ten on twelve | 10 pt type, 12 pt leading | 1.2 |
| 16/24 | sixteen on twenty-four | 16 px type, 24 px leading | 1.5 |
| 11/17 | eleven on seventeen | 11 pt type, 17 pt leading | about 1.55 |
The last column is the useful one. A ratio lets you compare settings at different sizes. A 1.5 ratio means the same proportions at 12 px, 16 px or 40 px.
What happens at each extreme
Your eye reads a line left to right, then jumps back to the start of the next line. The space between lines helps it find the correct next line.
- Too tight. Descenders (tails of letters like "g" and "y") from one line come close to ascenders (tall parts of letters like "d" and "l") on the line below. The lines form a dense block. The eye can slip back onto the same line or skip one.
- Too loose. The lines separate and no longer read as one paragraph. Each line looks like its own item. The eye has to travel farther on the return jump, and the paragraph looks like a list.
- Well balanced. The lines read as a single gray block of text, with a clear lane for the eye between rows.
A fast check is to squint at the paragraph until the words blur. A well-set paragraph looks like an even gray rectangle. Dark stripes with bright gaps suggest too much leading. Dark, muddy patches suggest too little.
Leading in CSS: line-height
On the web you set leading with the line-height property. It looks like it means the same thing as leading, but there is a difference.
In print, leading is the baseline-to-baseline distance. In CSS, line-height sets the height of each line box, which is the invisible box that holds one line of text. The browser centers the text's content area inside that box. The extra room is split equally above and below the text, and this split is called half-leading.
Here is the calculation for 16 px type with line-height: 1.5:
- The line box is 16 × 1.5 = 24 px tall.
- The font's content area (its ascent plus descent) might be about 18 px for this font.
- The extra space is 24 − 18 = 6 px, split as 3 px above and 3 px below.
Because the line boxes stack with no gaps, the baseline-to-baseline distance is 24 px. That matches the print definition of leading. The half-leading detail matters in two cases: when you align text with other elements, and when you see that two fonts with the same line-height show different visible gaps. Fonts have different ascent and descent values, so the empty space around the letters differs.
The CSS below shows three ways to write the same leading. Only the first is recommended, for reasons covered next.
/* All three give 24px of leading on a 16px paragraph. */
.unitless { font-size: 16px; line-height: 1.5; }
.percent { font-size: 16px; line-height: 150%; }
.fixed { font-size: 16px; line-height: 24px; }Why unitless values are safer
A unitless number is inherited as the number itself. Each child element multiplies it by its own font size. A value with a unit, such as 150%, 1.5em or 24px, is calculated once on the element where it is declared. Children inherit the finished length.
This matters when a parent and child have different font sizes:
.card {
font-size: 16px;
line-height: 150%; /* computed once: 24px, inherited as 24px */
}
.card .note {
font-size: 32px; /* inherits 24px: lines are now too tight */
}
.card-safe {
font-size: 16px;
line-height: 1.5; /* inherited as 1.5 */
}
.card-safe .note {
font-size: 32px; /* 32 x 1.5 = 48px: proportions kept */
}In .card .note, the 32 px text has only 24 px of leading, a ratio of 0.75. The lines overlap. In .card-safe .note, the ratio stays at 1.5. Use unitless values for body text unless you have a reason to lock an exact length.
Leading depends on more than the number
A ratio is a starting point. Several things change what looks right:
- Type size. Small type usually needs a higher ratio. Large display type, such as headlines, usually needs a lower one. A ratio that suits 16 px body text looks loose on a 48 px heading.
- Line length. Long lines need more leading, so the eye can find the next line after a long return jump. The interaction chapter covers this.
- Typeface. A font with a large x-height (tall lowercase letters), wide letterforms or a heavy weight looks denser and usually needs more space. A later chapter explains this.
Treat any single "correct" ratio with suspicion. A common default of about 1.5 for body text works well in many cases, and the next chapter gives ranges. It is still only a starting point that you adjust by eye.
Common mistakes
- Using the browser default for everything. The default
line-height: normaldepends on the font's built-in metrics. It is often tighter than comfortable for body text and differs between fonts. Set it explicitly. - Setting a fixed pixel height on the container. If you set
line-height: 24pxand a user enlarges their text, the leading stays at 24 px while the type grows. The lines crowd or overlap. - Using one ratio for headings and body text. A heading with
line-height: 1.5often looks like separate lines. Headings generally take smaller ratios. - Adjusting leading to fit more text in a box. Squeezing the lines to avoid scrolling trades readability for space. Shorten the text or change the layout instead.
- Mixing units. Unitless on the body, then
emor%on a child, creates the inheritance problem shown earlier.
A quick routine for testing leading
You can check leading on a real page with only the browser's developer tools:
- Select a paragraph and note its computed
font-sizeandline-height. - Divide the line height by the font size to get the ratio.
- Squint at the block. Look for even gray texture.
- Change
line-heightin steps of 0.05 or 0.1 and watch the texture. - Test the same ratio at your smallest and largest screen sizes.
Do this for each text style on the page: body, captions, headings. Each one usually ends up with a different ratio.
Exercise
A paragraph has font-size 18px and a measured baseline-to-baseline distance of 27px. What is the leading ratio, and how would you write it in CSS so it stays proportional if a child element uses a larger font size?
Show answer
The ratio is 27 / 18 = 1.5. Write it as a unitless value: line-height: 1.5. A unitless number is inherited as a multiplier, so each child multiplies it by its own font size. A value like 150% or 27px is computed once and inherited as a fixed length, which would make a larger child's lines too tight.
Exercise
A card sets font-size: 16px and line-height: 1.5em. A note inside it sets font-size: 24px. What is the note's line height in pixels, and what is its ratio to its own font size? Does the problem go away if you change 1.5em to 1.5?
Show answer
With 1.5em, the line height is computed on the card as 24px and inherited as 24px. The note's 24px type therefore has 24px of leading, a ratio of 1.0, so its lines are set solid. Changing to the unitless 1.5 fixes it, because the note then computes 24 x 1.5 = 36px, keeping the ratio at 1.5.