# Content that disappears on narrow screens and at 400% zoom

Source: https://easeweb.dev/learn/hidden-when-narrow
Topics: Zoom, reflow and text spacing > Content fits a 320px screen without sideways scrolling (WCAG 1.4.10)
The fix: Keep the content on the page at every width. Either let the panel follow the product in the single column, or, where the phone layout has to stay short, put it behind a Delivery and returns disclosure that is closed on narrow screens and open on wide ones.
Test with: zoom, screen reader
References: https://www.w3.org/WAI/WCAG22/Understanding/reflow.html https://www.w3.org/WAI/WCAG22/Techniques/failures/F102 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia

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.

## What happens

A homeware shop's product page has two columns on a laptop. On the left: "Enamel mug", $18, an Add to bag button and a line about the mug. On the right, a side panel, Delivery and returns: dispatched in 1 to 2 working days, delivery $4.95 and free on orders over $40, free returns within 30 days. For phones the design keeps the page short, the name, the price and the button, and leaves the panel out: the phone layout has no second column to put it in. The developer builds it as drawn and hides the panel below 48em.

Someone with low vision zooms the page to 400% in a window 1280 pixels wide, which leaves the page 320 CSS pixels. The layout switches to the phone one, and the panel goes with it. The page reads well: one column, nothing scrolls sideways. But the delivery cost and the returns period are nowhere on it, and nothing on it says where to find them. They learn the cost at checkout, or not at all. The same happens at 200% zoom, where the page is 640 pixels wide, and on every phone.

## Why it fails

Success criterion 1.4.10 asks that content can be presented at 320 CSS pixels wide "without loss of information or functionality". The Understanding page says that adjusting or relocating content is not a loss: a column can move under another, and a menu can fold behind a button. Removing it is. Failure F102 describes this case: content available at wider widths disappears at 320 pixels, when it is not offered in the single column or through some interaction instead. `display: none` takes the panel off the page, for screen readers as well as on screen, so at that width it isn't there for anyone.

Frameworks make it a one-word change. Bootstrap's display utilities hide an element below a breakpoint with `d-none d-md-block`, and Tailwind's `hidden md:block` does the same; Bootstrap's documentation presents them as the way to hide elements by screen size. The utility isn't the fault. Using it on content that has no other place at that width is.

## Who is affected

On a phone the panel is gone at every zoom level; on a laptop, once zoom leaves the page narrower than 48em, which in a window 1280 pixels wide it does at 200%.

## What automation and AI miss

A scanner that loads the page once, at desktop width, finds the panel and checks it. At 320 pixels there is nothing left to check: no overflow, no missing name, no contrast to measure. Finding the failure means comparing the page at two widths. The EaseWeb audit loads the page at 1280 pixels and notes every text and control shown, narrows the window to 320 by 256, presses up to eight buttons that may show more (menus, disclosures) and reports what is still missing, with the CSS that hides it. It counts links by where they go, so navigation hidden at 320 pixels isn't flagged when a menu shows the same links. When there are more buttons than it tries, or one leaves the page, it sends a lead for a person to check instead. AI fixes often go wrong in one of three ways:

- Hiding the panel only visually, with a visually-hidden class: screen readers read it again, but people who zoom still can't see it.
- Moving the text into a tooltip: on a phone there is no hover, and at 400% a tooltip covers much of the window.
- Removing the panel from the wide layout too, so the two layouts match: the content is now missing at every width.

## Before: the panel hidden below 48em

```html
<main class="product">
  <div class="product-info">
    <h1>Enamel mug</h1>
    <p class="price">$18</p>
    <button type="button" class="add">Add to bag</button>
    <p>Steel with a glossy enamel coat. Holds 350 ml.</p>
  </div>
  <aside class="product-side" aria-labelledby="delivery-title">
    <h2 id="delivery-title">Delivery and returns</h2>
    <p>Dispatched in 1 to 2 working days.</p>
    <p>Delivery $4.95, free on orders over $40.</p>
    <p>Free returns within 30 days.</p>
  </aside>
</main>
```

```css
.product {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 2rem;
}
@media (max-width: 47.99em) {
  .product {
    grid-template-columns: 1fr;
  }
  .product-side {
    display: none;
  }
}
```

- Below 48em the panel is `display: none`.
- At 200% zoom or more in a window 1280 pixels wide, and on a phone, the dispatch time, the delivery cost and the returns period aren't on the page, and nothing on it leads to them.
- `display: none` removes the panel for screen readers too, so at those widths nobody gets it.

## After: the panel follows the product

```html
<main class="product">
  <div class="product-info">
    <h1>Enamel mug</h1>
    <p class="price">$18</p>
    <button type="button" class="add">Add to bag</button>
    <p>Steel with a glossy enamel coat. Holds 350 ml.</p>
  </div>
  <aside class="product-side" aria-labelledby="delivery-title">
    <h2 id="delivery-title">Delivery and returns</h2>
    <p>Dispatched in 1 to 2 working days.</p>
    <p>Delivery $4.95, free on orders over $40.</p>
    <p>Free returns within 30 days.</p>
  </aside>
</main>
```

```css
.product {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 2rem;
}
@media (max-width: 47.99em) {
  .product {
    grid-template-columns: 1fr;
  }
}
```

1. Remove `display: none` from the narrow layout. Below 48em the grid has one column, and the panel follows the product, after its description, in the order of the markup.

This fixes the Before and passes 1.4.10: the panel moves rather than disappearing, which the Understanding page does not count as a loss. On a phone the page gets a little longer, by the panel's heading and three lines.

## After: a disclosure on narrow screens

```html
<main class="product">
  <div class="product-info">
    <h1>Enamel mug</h1>
    <p class="price">$18</p>
    <button type="button" class="add">Add to bag</button>
    <p>Steel with a glossy enamel coat. Holds 350 ml.</p>
  </div>
  <aside class="product-side" aria-labelledby="delivery-title">
    <details class="side-details" open>
      <summary id="delivery-title">Delivery and returns</summary>
      <p>Dispatched in 1 to 2 working days.</p>
      <p>Delivery $4.95, free on orders over $40.</p>
      <p>Free returns within 30 days.</p>
    </details>
  </aside>
</main>
```

```css
.product {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 2rem;
}
@media (max-width: 47.99em) {
  .product {
    grid-template-columns: 1fr;
  }
}
```

```js
const details = document.querySelector('.side-details');
const wide = matchMedia('(min-width: 48em)');
const fit = () => {
  details.open = wide.matches;
};
fit();
wide.addEventListener('change', fit);
```

1. Put the panel's text in a `details` element with the `open` attribute, and make its title the `summary`. The `aside` still takes its name from the title's id.
2. Remove `display: none` from the narrow layout.
3. With a short script, close the panel below 48em and open it at 48em and wider, and again each time the width crosses that line. Without the script, the panel is simply open at every width.

This fixes the Before and passes 1.4.10: below 48em the panel's text is one press away, which F102 accepts as content offered "through some interaction". Tab reaches the summary, and the browser tells screen readers whether it is expanded or collapsed. On a wide screen the summary can still close the panel, which does no harm.

## Which option to use

Both keep the delivery cost on the page at every width and pass 1.4.10. Letting the panel follow the product is recommended: it removes one CSS rule, needs no script, and shows the cost to everyone without a press, at the price of a slightly longer phone page. The disclosure keeps the phone page as short as it was drawn, at the price of a press and a script. Choose it when the panel is long, such as a size chart or a full returns policy, and the people who want it will look for it.

## Implementation decisions

**What may go at narrow widths.** Content that is on the page another way at that width: wide navigation replaced by a menu button that shows the same links (the Understanding page's own example), a decorative image, a second copy of something the single column already shows. Anything else moves into the column or behind a control.

**Find every hiding rule.** Look in the narrow media and container queries for `display: none`, `visibility: hidden`, a zero height or width, and a `hidden` attribute that a script sets by width. In templates, look for framework utilities that hide below a breakpoint: `d-none d-md-block` in Bootstrap, `hidden-xs` in Bootstrap 3, `hidden md:block` in Tailwind.

**Text cut short.** A title with `text-overflow: ellipsis`, or a box with `overflow: hidden`, loses the end of its text at 320 pixels. That is fine only when the full text is on the page too, as in [floating buy bars that cover the page when zoomed in](/learn/floating-buttons), where the name in the bar repeats the page's heading. Otherwise let it wrap.

**Tables that drop columns.** A data table that hides its less important columns on small screens loses them too. Show them behind a control, or let the whole table scroll inside its own box, which 1.4.10 allows for data tables; [pages that scroll sideways on a narrow screen](/learn/reflow) shows how.

**The heading in the disclosure.** The summary takes the place of the `h2`. HTML allows a heading inside a `summary`; if you keep one there, check with the screen readers you support that it is still listed as a heading.

**Where it goes in the column.** The stacked panel follows the description, in the order of the markup. If people need it before they choose, such as a delivery cost, put it before the button in the markup rather than moving it there with CSS `order`, so the reading order and the order on screen stay the same.

## Verify the fix

1. In a window 1280 pixels wide, zoom the browser to 400% (320 by 256 CSS pixels; responsive mode in the developer tools at that size works too) and read each page template from top to bottom.
2. Open the same page at 100% beside it and go through it section by section: every piece of information and every control at 100% is on the 400% page too, or behind a control that shows it.
3. At 400%, press every menu button, disclosure and tab, and check that what it shows can be read, used and closed again.
4. On a phone, with VoiceOver or TalkBack, read the page from top to bottom and check that the content, or the control that shows it, can be found.

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the layout's breakpoints or the responsive utilities in the templates change.

## Limits

This is a starting pattern, not a guarantee for every application. Comparing two widths finds what has gone, not whether what is left makes sense: check that the reading order still works once the columns stack. A page that scrolls sideways at 320 pixels is a different failure, covered in [pages that scroll sideways on a narrow screen](/learn/reflow), and a dialog that is on the page but runs past the edges of a short window in [modals cut off at the top and bottom when zoomed in](/learn/modals-cut-off). Paths and class names in the snippets are placeholders.

---

Get this guide in your coding agent: MCP https://easeweb.dev/mcp (setup at https://easeweb.dev/services/developers)
