CSS basics: Readable typography
Font size, line height, and line length work together. Line height without a unit scales with the text.
Current edit
Understand the pattern
Font size, line height, and line length work together. Line height without a unit scales with the text.
Font size, line height, and line length work together. Line height without a unit scales with the text.
Misconceptions to reject
- If the page fits one desktop viewport, no narrower viewport needs checking.
- Hiding all overflow always makes content accessible.
The preview is a sanitized subset, not a full browser compatibility test.
Worked example and expected result
p { font-size: 1rem; }
p { line-height: 1.6; }
p { max-width: 65ch; }Font size, line height, and line length work together. Line height without a unit scales with the text.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: CSS basics: Spacing with paddingTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.
Keep learning
- 01CSS basics: Color tokensCustom properties centralize reusable values; var() reads a token and can provide a fallback.Practice
- 02CSS basics: Spacing with paddingPadding creates space inside the border; it does not separate the element from its neighbors.Practice
- 03CSS basics: Spacing with marginMargin creates space outside an element. Block margins can collapse in normal flow.Practice