Skip to content
easeweb
Search topics

Fixed-height boxes that cut off enlarged text

A header with a fixed height and hidden overflow cannot grow when the text gets bigger, so part of the menu is cut off.

WCAG 2.2
SC 1.4.4AA
Required by
Section 508 · EN 301 549 (EU)
Broken height: 80px
The accessibility problem illustrated: Low vision:Where is Gift sets?
01

The problem

People who enlarge text can't read, or see where they are on, the part of the page that is cut off

02

Try it

Enlarge the text to 200% and read the menu

Drag the Text size slider. Can you still read every link in the header?

Simulate
100%

Broken Can you fix this?

BrokenA header with a fixed height
Inkwell & Co Cart (2)

Autumn notebooks are in

Hand-bound, 120 pages, in four colours.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Let every box that holds text grow with it

Before
BrokenA header with a fixed height
<header class="site-header">  <a href="/" class="logo">Inkwell &amp; Co</a>  <nav aria-label="Main">    <ul class="site-nav">      <li>        <a href="/collections/pens">Pens</a>      </li>      <li>        <a href="/collections/paper">Paper</a>      </li>      <li>        <a href="/collections/gift-sets">Gift sets</a>      </li>      <li>        <a href="/pages/workshops">Workshops</a>      </li>      <li>        <a href="/blogs/journal">Journal</a>      </li>      <li>        <a href="/pages/contact">Contact</a>      </li>    </ul>  </nav>  <a href="/cart" class="cart">Cart (2)</a></header>
What is wrong2 points
  • At 200% links are cut off: they need two or three rows, but the header stays 80 pixels tall and hides the rest.
  • Keyboard users lose sight of focus: the hidden links are still in the page and in the tab order, so focus moves onto text nobody can see.
After

Let the header grow

<header class="site-header">  <a href="/" class="logo">Inkwell &amp; Co</a>  <nav aria-label="Main">    <ul class="site-nav">      <li>        <a href="/collections/pens">Pens</a>      </li>      <li>        <a href="/collections/paper">Paper</a>      </li>      <li>        <a href="/collections/gift-sets">Gift sets</a>      </li>      <li>        <a href="/pages/workshops">Workshops</a>      </li>      <li>        <a href="/blogs/journal">Journal</a>      </li>      <li>        <a href="/pages/contact">Contact</a>      </li>    </ul>  </nav>  <a href="/cart" class="cart">Cart (2)</a></header>
How it is fixed2 steps
  1. Change height to min-height. The header keeps its 80 pixels at the default size and grows when the text needs more.
  2. Remove overflow: hidden. At 200% the links wrap onto more rows and the header grows to hold them, so every link is visible and every focused link can be seen.

This fixes the Before and passes 1.4.4. The HTML doesn't change. If the background pattern needs cropping, crop it on an element of its own (see Implementation decisions).

04

Verify the fix

5 checks, no mouse.

Test with: Zoom, Keyboard

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared header or theme settings change.

How screen readers handle aria-expanded

Limits

This is a starting pattern, not a guarantee for every application. Strictly, 1.4.4 can be met by full-page zoom alone, but many people enlarge text only, and a box that clips then also clips at zoom when the page is narrow. Paths and class names in the snippets are placeholders. Test every page template, not only the header.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service