Barrierepruefung.de Web Accessibility Checker

Horizontal scrolling at 320 pixels width

The finding means that in a window 320 CSS pixels wide the page is wider than the window, so users would have to scroll sideways. Fixed widths, media without max-width, wide tables and long words or addresses cause it. Flexible widths, wrapping and a scrollable region of their own for tables fix it.

Last reviewed: Sources

The message

Identifier
own.reflow-320
Type of check
automatic
Severity
serious
Success criterion
Meaning
At a width of 320 CSS pixels, content extends beyond the viewport.
Impact
At high magnification or on small displays, users must scroll in two directions.
Fix
Avoid fixed widths; use flexible layouts and max-width: 100%.

How does your website stand?

The free check shows what can be measured automatically, with the location. No account.

Check website for free

What the rule checks

The page is loaded separately in a window 320 CSS pixels wide. That matches a 1280-pixel window at 400% zoom. The check does not emulate a mobile device; it measures the layout the page actually renders at that width.

If the document is wider than the window, the rule looks for the elements that extend beyond the right edge and reports the outermost one in each case, not its children. Elements inside a region that scrolls horizontally on its own (overflow-x: auto or scroll) are not reported. For tables, maps and diagrams the criterion explicitly allows such scrolling.

The rule only measures width. Content that disappears or overlaps when the layout reflows is not detected.

Common causes

  • Fixed widths. A container with width: 960px, or a body with a min-width.
  • Media with a fixed size. Images, videos and embedded maps or videos in an <iframe> with a width attribute and no max-width.
  • Wide tables. A data table that does not sit in a scrollable region of its own.
  • Long strings. Web addresses, email addresses and long compound words that are not allowed to break.
  • Bars that do not wrap. Menus and button bars with white-space: nowrap, or flexbox without flex-wrap.
  • Parked menus. A closed side menu waits beyond the right edge of the window, for instance with left: 100%, and makes the document wider although nobody can see it.

How to fix it

Media shrink with the window when they may never grow wider than their container:

img,
video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
  aspect-ratio: 16 / 9; /* height follows width */
  height: auto;
}

.content {
  max-width: 60rem; /* instead of width: 960px */
  margin-inline: auto;
}

Columns and bars wrap instead of staying side by side (C31, C32):

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
}

Long words and addresses may break anywhere:

.prose {
  overflow-wrap: anywhere;
  hyphens: auto; /* uses the page's lang attribute */
}

A data table gets a scrollable region of its own. To make it scrollable by keyboard as well, the region is focusable and named:

<div class="table-wrap" role="region" aria-label="Opening hours" tabindex="0">
  <table>…</table>
</div>
.table-wrap {
  overflow-x: auto;
}

Take a closed side menu out of the layout while it is closed, for instance with the hidden attribute. It then counts neither towards the width nor in the tab order.

To check by hand, set the window to 320 pixels wide in the developer tools, or zoom a 1280-pixel window to 400%. What else the criterion exempts is explained on the page about WCAG 1.4.10.