Course contentsShow
← Web Development
Lesson 586 of 2,98210. Typography and Design SystemsFree lesson

Line Length and Measure

Setting optimal line lengths (45-75 characters) for readability using max-width and ch units.

Line Length and Measure

You'll learn how to set optimal line lengths for better readability using CSS units and properties.

Why Line Length Matters

Imagine reading a newspaper column that stretches across an entire poster board—your eyes would get exhausted tracking from the end of one line all the way back to the start of the next. That's why newspapers use narrow columns. The same principle applies to web typography.

The measure is the length of a line of text. Research shows that the ideal measure for comfortable reading is 45–75 characters per line, with around 66 characters being the sweet spot. Lines that are too long tire the reader's eyes; lines that are too short create choppy, fragmented reading.

Setting Optimal Line Length

CSS gives us tools to control measure, particularly the max-width property combined with the ch unit. The ch unit represents the width of the "0" (zero) character in the current font, making it perfect for character-based measurements:

p {
  max-width: 65ch; /* Roughly 65 characters wide */
  font-size: 1.125rem;
}

This constrains paragraphs to about 65 characters, regardless of screen size. On wide monitors, your text won't stretch uncomfortably across the entire viewport.

Combining with Fluid Typography

Since you've already learned clamp() for fluid typography, you can create responsive measures that adapt gracefully:

.content {
  max-width: clamp(45ch, 90%, 75ch);
  margin-inline: auto;
}

This sets a flexible container that never gets too narrow (45ch) or too wide (75ch), but can be 90% of its parent when space is limited.

Key Takeaway: Use max-width with ch units to keep line lengths between 45–75 characters for optimal readability, preventing eye strain from overly long lines.