Skip to content
easeweb
Search topics

Pages that scroll sideways on a narrow screen

A card grid whose columns can't shrink below 320 pixels doesn't fit a 320-pixel screen once the page's padding is added, so every card runs off the right edge.

WCAG 2.2
SC 1.4.10AA· new in 2.1
Required by
EN 301 549 (EU)
Broken minmax(320px, 1fr)
The accessibility problem illustrated: Low vision:Where's the rest of the page?
01

The problem

People who zoom in to read have to scroll sideways to read every line, and can miss what is past the edge

02

Try it

Zoom the page to 400% and read the classes

Drag the Zoom slider. The window stays 1280 pixels wide, so at 400% the page has 320 CSS pixels. Do the cards still fit?

Simulate
100%

Broken Can you fix this?

BrokenA grid with a fixed minimum column width

Classes this month

  • Wheel basics

    Saturday 14 November, 10:00 to 13:00

    $65

    Book
  • Glazing

    Sunday 15 November, 14:00 to 16:00

    $65

    Book
  • Hand building

    Saturday 21 November, 10:00 to 12:00

    $65

    Book

Page width: 1280 CSS pixels.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Let every column shrink to the width of its container

Before
BrokenA grid with a fixed minimum column width
<main class="page">  <h1>Classes this month</h1>  <ul class="classes">    <li class="class-card">      <h2>Wheel basics</h2>      <p>Saturday 14 November, 10:00 to 13:00</p>      <p class="price">$65</p>      <a href="/classes/wheel-basics" class="book">Book</a>    </li>    <!-- Glazing, Hand building -->  </ul></main>
What is wrong2 points
  • The cards don't fit at 320 pixels: the grid has 280 pixels there, but each column insists on 320.
  • Every card runs 20 pixels past the right edge of the screen, and the page scrolls sideways.
After

Cap the column minimum at the container width

<main class="page">  <h1>Classes this month</h1>  <ul class="classes">    <li class="class-card">      <h2>Wheel basics</h2>      <p>Saturday 14 November, 10:00 to 13:00</p>      <p class="price">$65</p>      <a href="/classes/wheel-basics" class="book">Book</a>    </li>    <!-- Glazing, Hand building -->  </ul></main>
How it is fixed1 step
  1. Wrap the column minimum in min(100%, 320px). It is 320 pixels while the grid is wider than that, and the grid's own width when it is narrower. On a wide screen nothing changes: columns are still at least 320 pixels and fill the row. At 320 pixels the single column shrinks to 280 and fits.

This fixes the Before and passes 1.4.10. Because it measures the grid itself, not the window, it holds wherever the grid is placed: beside a sidebar, inside a dialog, or in a narrow column.

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 layout or grid styles change.

Limits

This is a starting pattern, not a guarantee for every application. Passing at 320 pixels doesn't make a layout good at 320 pixels: check that the reading order still makes sense once the columns stack, and that nothing important has been pushed far down the page. A phone held on its side is a narrow, short screen too; a page that hides itself there is a different failure, covered in pages locked to portrait or landscape. Paths and class names in the snippets are placeholders. Test every page template, not only the one with the card grid.

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