Skip to content
Guest
Learn CSS · Course Syllabus Show lessons
Core Foundations · 8 min read · Beginner

Typography, Readability & text-wrap

Craft editorial-grade reading experiences with comfortable measure (ch), unitless line-height, text-wrap: balance, and tabular numerals.

What you'll learn

  • Use unitless line-height (e.g., 1.6) so text scales cleanly
  • Limit paragraph width to 60–75ch for effortless scanning
  • Eliminate awkward single-word headline orphans with text-wrap: balance

Over 80% of the web is text. Great typography (like you see on web.dev)comes down to four simple CSS habits:

  1. Unitless line-height: Always write line-height: 1.6 (not 24px) so child headings scale proportionally.
  2. Readable line length: Cap prose containers at max-width: 65ch.
  3. Balanced headings: Add text-wrap: balance to h1–h3 so multi-line titles wrap evenly instead of leaving one lonely word on the last line.
  4. Tabular numbers: Add font-variant-numeric: tabular-nums on timers, prices, and progress counters so digits don’t jitter horizontally as they change!

Fill-in-the-Blank Exercise

Modern Editorial Typography

Balance heading line wraps and cap paragraph width at 65 characters.

h1 {
text-wrap: ;
}
p {
max-width: 65;
line-height: 1.65;
}

Try It Yourself

Compare the balanced headline vs. the unbalanced headline below, and toggle max-width on the paragraph:

Balanced Headings & Readable Measure
Live Result

Check Your Understanding

Score: 0 / 1

1. What does text-wrap: balance do on a multi-line heading?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind