Sub topic 14
Checking a Paragraph by Eye and Fixing It
This chapter assumes you know the earlier ideas in this tutorial: leading, measure, unitless line-height, max-width in ch, and the WCAG text-spacing criterion. You also need basic CSS. Here you combine those pieces into a repeatable review routine. You look at a paragraph, name what is wrong, and change one thing at a time.
Why check by eye first
Numbers like "45 to 75 characters" and "1.4 to 1.6 leading" are starting points. They are ranges that work for many typefaces, not rules. A font with a large x-height or a wide design can look cramped at 1.5. A narrow column in a light font can look loose at 1.4.
Your eyes are the final test, because reading is what the spacing is for. The routine below gives your judgment a structure so that you fix causes and not symptoms.
The five-step review
Run these steps in order. Each step targets one property, and the order matters because changing the measure changes what leading it needs.
- Check the type size.
- Count the measure.
- Squint at the texture.
- Test the return trip.
- Stress the paragraph with user overrides.
Step 1: Type size
Start here because every other value depends on it. Body text on the web is normally 16px or larger (1rem by default). If the text looks small, raise the size first. Adjusting leading to compensate for text that is too small does not work.
Step 2: Count the measure
Pick a full line in the middle of the paragraph, not the first or last line. Count its characters, including spaces. The commonly cited comfortable range for body text is 45 to 75 characters, with about 66 often named as ideal.
You do not have to count by hand. This function reports how many ch units fit in an element's content box:
function chPerLine(el) {
const probe = document.createElement("span");
probe.style.cssText = "position:absolute;visibility:hidden;width:100ch;";
el.appendChild(probe);
const chPx = probe.getBoundingClientRect().width / 100;
el.removeChild(probe);
const cs = getComputedStyle(el);
const inner =
el.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight);
return inner / chPx;
}
console.log(chPerLine(document.querySelector("p")).toFixed(1));The ch unit is the width of the digit "0" in the element's font. Most lowercase letters are narrower than "0", so running text usually holds somewhat more characters than the ch count. For that reason, a max-width of 65ch often gives lines near the upper part of the comfortable range. Treat the function as a quick estimate and confirm with a real count.
Two failure modes:
- Too long (above about 80). The eye loses its place when it jumps back from the end of one line to the start of the next.
- Too short (below about 40). The eye changes lines too often, and justified or hyphenated text starts to show ugly gaps and breaks.
Step 3: Squint at the texture
Lean back or blur your eyes until you cannot read the words. A well-set paragraph looks like an even gray rectangle. Then judge what you see:
- Dark, dense stripes mean the leading is too tight. Ascenders of one line nearly touch descenders of the line below.
- Pale, separated stripes mean the leading is too loose. Each line reads as its own strip, and the paragraph falls apart.
- Uneven patches or white channels running down the block mean a spacing problem in the words themselves. Justified text with a short measure often produces these "rivers".
Step 4: Test the return trip
Read the end of a line and move to the start of the next. Check whether you find the right line without effort. If you sometimes land on the same line again or skip one, the cause is usually a long measure with leading that is too tight. Fix it with a shorter measure, more leading, or both.
Step 5: Stress test
Apply the WCAG 1.4.12 overrides and check that nothing is clipped or overlapped. The next section shows how.
A worked example
Here is a paragraph that fails several checks. It sits in a full-width container on a wide monitor.
.post p {
font-size: 0.8rem;
line-height: 1.15;
width: 100%;
}Run the routine:
| Step | Observation | Diagnosis |
|---|---|---|
| 1. Size | 12.8px text looks small | Size is below the usual body minimum |
| 2. Measure | About 150 characters per line | Far above the comfortable range |
| 3. Squint | Dense, dark stripes | Leading is too tight |
| 4. Return trip | Easy to land on the wrong line | Long measure plus tight leading |
Fix them in order, re-checking after each change.
.post p {
font-size: 1rem;
line-height: 1.5;
max-width: 65ch;
}The size now meets the normal body minimum. The 65ch limit brings the line into the comfortable range. 1.5 gives the squint test an even gray block. If you later widen the column to 70ch, raise the leading slightly to 1.6, as covered in the chapter on how measure and leading interact.
Fix causes, not symptoms
A symptom can have more than one cause. Pick the cause that changes the fewest things.
| Symptom | Likely cause | Fix |
|---|---|---|
| Eye loses its place at line starts | Measure too long | Lower `max-width` (for example `70ch` to `60ch`) |
| Same symptom, but the measure is fine | Leading too tight for the typeface | Raise `line-height` by 0.05 to 0.1 |
| Lines look like separate stripes | Leading too loose | Lower `line-height` toward 1.4 |
| Choppy reading, many short lines | Measure too short | Raise `max-width`, or reduce side padding |
| Text looks cramped in one font only | Large x-height or wide letterforms | Add leading for that font |
| Gaps and rivers in justified text | Short measure with justification | Use `text-align: left`, or enable hyphenation |
Change only one value per round. If you change size, measure, and leading together, you cannot tell which change helped.
Check across screen sizes
A paragraph that passes at one width can fail at another. Check at least three widths: a phone around 360px, a tablet, and a wide desktop.
- On a phone, the column is narrow and the measure may fall below 40 characters. Reduce side padding before reducing the font size. Slightly lower leading, such as
1.45, can keep the shorter lines from looking airy. - On a wide screen,
max-width: 65chstops the measure from growing. Without a cap, text spreads across the whole window.
.post p {
font-size: 1rem;
line-height: 1.5;
max-width: 65ch;
padding-inline: 1rem;
}
@media (min-width: 60rem) {
.post p {
font-size: 1.125rem;
line-height: 1.6;
max-width: 68ch;
}
}Because ch depends on the font size, the 68ch cap scales with the larger type. The measure in characters stays stable while the pixel width grows.
Stress test with the WCAG overrides
WCAG 2.1 success criterion 1.4.12 (Text Spacing) does not say your page must use these values. It says that when a user sets them, content must not be lost or overlapped. Those values are:
- Line height at least 1.5 times the font size.
- Paragraph spacing at least 2 times the font size.
- Letter spacing at least 0.12 times the font size.
- Word spacing at least 0.16 times the font size.
Inject this stylesheet in your browser's dev tools, or add it temporarily, and look for problems:
* {
line-height: 1.5 !important;
letter-spacing: 0.12em !important;
word-spacing: 0.16em !important;
}
p {
margin-bottom: 2em !important;
}Look for these failures:
- Text cut off inside buttons, cards, or tabs with a fixed
height. - Text overflowing a container that has
overflow: hidden. - Lines overlapping because a parent set
line-heightin a fixed unit such as20px. - Horizontal scrolling where the layout had none before.
Fixed heights are the usual cause. Use min-height or let the content size the box. This is another reason to prefer unitless line-height: it recalculates when the font size changes, while a pixel value does not.
Common review mistakes
- Judging at one zoom level. Check at 100% and at 200%. Many readers zoom.
- Reviewing only the first line. Headings, drop caps, and ragged ends mislead you. Judge from the middle of the paragraph.
- Judging with placeholder text. "Lorem ipsum" has an unnatural word length. Use real copy where you can.
- Treating a ratio as final.
1.5is a starting value. If the squint test says it is wrong for your font, change it.
Summary of the routine
Review in the order size, measure, texture, return trip, stress test. Diagnose the cause before editing. Change one value at a time, and re-check at several widths. Your numeric ranges tell you where to start, and your eyes tell you when to stop.
Exercise
A paragraph in a 16px serif font has about 95 characters per line and line-height: 1.4. Readers say they often lose their place when moving to the next line. Describe the first change you would make, and how you would verify it.
Show answer
Shorten the measure first, since 95 characters is above the comfortable range of about 45 to 75. Set max-width to around 65ch on the paragraph. Then verify it by counting characters on a middle line (or with a ch measuring script) and by repeating the return-trip check. If the problem remains, raise line-height to about 1.5 or 1.6 as a second, separate change.
Exercise
A card component has height: 120px; overflow: hidden; and line-height: 20px. After you apply the WCAG 1.4.12 override stylesheet, the last line of text disappears. Why does this fail, and what do you change?
Show answer
The fixed height cannot hold the taller lines and extra spacing produced by the overrides, and overflow: hidden clips what no longer fits. The fixed 20px line height also does not scale with font size. Replace the fixed height with min-height (or remove it), remove overflow: hidden or make sure it does not clip text, and use a unitless line-height such as 1.5.