Sub topic 4
How long should a line be?
This chapter covers the commonly cited ranges for line length, called the measure, and how to apply them in CSS. It assumes you know what font size means and can read basic HTML and CSS. The measure is the width of a text line. Designers usually count it in characters, including spaces, because the count stays meaningful when font size or typeface changes.
Why the measure matters
At the end of each line, your eyes sweep back to the start of the next one. On a very long line, that return trip is long. Readers lose their place and sometimes re-read the same line. On a very short line, the eyes jump back so often that reading turns choppy, and the text breaks into fragments.
Pixel widths do not capture this. A 600px column holds many more characters at 14px than at 20px, so the reading experience differs even though the width is the same. Characters per line is the more reliable measure.
Commonly cited ranges
These ranges are guidelines drawn from typographic practice, not strict rules.
| Context | Characters per line |
|---|---|
| Comfortable single-column body text | about 45 to 75 |
| Often-cited ideal | about 66 |
| Narrow columns, captions, sidebars | about 30 to 45 |
| Multi-column layouts | often shorter, around 40 to 50 |
A common practical target for web articles is 50 to 75 characters. The WCAG success criterion 1.4.8 (a AAA-level criterion) says lines should be no more than 80 characters wide. That makes 80 a sensible upper limit.
Setting the measure in CSS
CSS has a ch unit. One ch equals the width of the "0" glyph in the element's font. Because most text is narrower than "0" on average, a 65ch box usually holds a little more than 65 characters of running text. That still lands in the comfortable range.
body {
font-size: 1rem;
line-height: 1.5;
}
p {
max-width: 65ch;
}Use max-width, not width. With max-width, the paragraph can shrink on a narrow screen and never grows past the limit on a wide one. The ch unit is relative to the element's own font, so if you change the paragraph's font size, the measure scales with it. You do not need to recalculate a pixel value.
The measure and leading adjust together, so a wider measure gets slightly more leading. Later chapters cover that in detail, but you can already see the pattern here:
body {
line-height: 1.5;
}
.article p {
max-width: 70ch;
line-height: 1.6;
}
.caption {
max-width: 45ch;
line-height: 1.4;
}The article text has a wider measure, so it gets a little more leading. The narrow caption gets a little less.
Common errors
- Setting the width on the page container only. A wide container with no limit on the paragraphs gives lines of 120 characters or more on a large monitor. Limit the text element itself.
- Using
max-widthin pixels and then changing the font size. The character count drifts. Usechso the limit follows the type. - Applying
chto the wrong element. If you setmax-width: 65chon a container whose font size differs from its paragraphs, the result is not 65 characters. Set it on the element that holds the text, or make sure the font sizes match. - Forgetting that headings differ. Large headings have larger glyphs, so the same
chvalue on a heading creates a much wider box. Give headings their own limit if they wrap.
Checking your result
Open the page and count the characters on a few full lines in the middle of a paragraph. Ignore the first and last lines. If most lines fall between about 45 and 80 characters, the measure is in range. Then read a paragraph. If you lose your place at line breaks, the lines are probably too long. If the text feels broken into pieces, they are probably too short.
Exercise
A paragraph has font-size: 1.25rem and max-width: 600px. A reader reports lines are hard to follow on a large monitor after you later raise the font size to 1.5rem. Which CSS would you change it to, and why does it keep the measure stable?
Show answer
Use max-width: 65ch. The ch unit is based on the element's own font, so the box widens as the font grows and the number of characters per line stays about the same. A fixed 600px box would hold fewer characters at 1.5rem, which makes lines shorter and choppier.
Exercise
You count 95 characters on a typical full line of an article. What is the problem, and what is a first fix?
Show answer
The line is above the roughly 80-character upper limit, so readers may lose their place when moving to the next line. Set max-width on the paragraph to a value such as 65ch or 70ch, then recount.