Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 38 ยท Colour, Contrast and Media

Text Resizing, Reflow and Spacing

Make pages work at 200% zoom and 320px width: relative units, responsive layouts, no horizontal scroll, and CSS that survives user text-spacing overrides.

People with low vision rarely use a screen reader. They zoom. They set a larger default font, enlarge the whole page to 400%, or override line spacing in a custom stylesheet. A page that breaks under those changes locks them out. Three WCAG criteria describe what "works" means.

Criterion Level Requirement
1.4.4 Resize Text AA Text can be enlarged to 200% without loss of content or function (without assistive technology).
1.4.10 Reflow AA At 400% zoom (a 320 CSS px wide viewport), content fits without two-dimensional scrolling.
1.4.12 Text Spacing AA No loss when users apply larger spacing (see below).

Use relative units

If you set body text in px, some browsers' "default font size" setting will not change it. Use rem (relative to the root font size) for text and most spacing, and em when something should scale with its parent.

CSS
html { font-size: 100%; }      /* respect the user's setting, usually 16px */
body { font-size: 1rem; line-height: 1.5; }
h1   { font-size: 2rem; }
.btn { padding: 0.5em 1em; }   /* grows with the button's own text */

Never set html { font-size: 62.5% } tricks without reverting to normal sizes in body; they shrink text for users who chose larger defaults.

Do not disable zoom either. A viewport meta tag with user-scalable=no or maximum-scale=1 fails 1.4.4 on mobile.

HTML
<!-- Good -->
<meta name="viewport" content="width=device-width, initial-scale=1">

Reflow: one column at 320 px

400% zoom on a 1280 px wide screen gives a viewport of 320 CSS px. Your responsive layout should already collapse to a single column there. The test is simple: no horizontal scrollbar for normal text content.

Things that commonly cause horizontal scroll:

  • Fixed widths (width: 600px). Prefer max-width and percentages.
  • Long unbroken strings (URLs, German compound words). Add overflow-wrap: anywhere; or overflow-wrap: break-word.
  • Wide pre blocks and images. Use max-width: 100%; height: auto for images.
  • Fixed-position bars that eat half the viewport.

Exceptions: data tables, maps, diagrams, code blocks and toolbars may scroll in two dimensions if that is essential, but give the scrolling region its own container instead of scrolling the whole page.

Fixed width vs flexible

Text spacing overrides

Some readers (people with dyslexia or low vision) apply a user stylesheet. 1.4.12 says your layout must survive these values without clipped or overlapping text:

  • Line height at least 1.5 times the font size.
  • Spacing after paragraphs 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.

You do not have to use those values; you must not break when someone applies them. What breaks? Fixed heights, overflow: hidden on text containers, and absolute positioning of labels.

The demo applies the override with a button so you can see which card survives.

Apply the text spacing override

Rules of thumb: use min-height rather than height, let containers grow, and avoid overflow: hidden on anything that contains text.

Target size and zoomed layouts

When the page is zoomed, controls grow too, but cramped toolbars can overlap. Design with generous hit areas: WCAG 2.2 adds 2.5.8 Target Size (Minimum) at AA, requiring at least 24 by 24 CSS px for pointer targets (with exceptions for inline links and sufficient spacing).

Testing it

  1. Press Ctrl and plus (Cmd and plus on macOS) until the browser says 400%, then scroll through the page.
  2. Increase the browser's default font size to "Very large" and reload.
  3. Use a bookmarklet or extension that applies the four text-spacing values.
  4. Check mobile in landscape and portrait.
flowchart LR
  A["Zoom 200 percent"] --> B["Text still readable, nothing lost"]
  B --> C["Zoom 400 percent / 320px wide"]
  C --> D["One column, no sideways scroll"]
  D --> E["Apply text-spacing override"]
  E --> F["No clipping or overlap"]

Run these three checks on every template.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What viewport width in CSS pixels corresponds to 400% zoom on a 1280 px screen?

    1280 divided by 4 is 320 CSS pixels, which is the width Reflow (1.4.10) is measured at.
  2. 2. Which viewport setting fails the Resize Text criterion on phones?

    user-scalable=no (or a small maximum-scale) blocks pinch zoom.
  3. 3. Which CSS most likely clips text when the user increases line spacing?

    A fixed height with hidden overflow cannot grow, so extra spacing pushes text out of view.
  4. 4. Which is not one of the 1.4.12 spacing values?

    1.4.12 covers line height, paragraph spacing, letter spacing and word spacing, not weight.

Summary

  • Use rem and em, never block zoom, and respect the browser default size.
  • Reflow means one column and no sideways scroll at 320 CSS px.
  • Let boxes grow: min-height, no clipping of text, break long strings.
  • Test by zooming, enlarging the default font, and applying text-spacing overrides.

Next: Images and Alternative Text in Depth