Focused items hidden by sticky parts

How the scan tabs through the page and tests whether focused items stay visible, when it fails, and how to stop sticky headers and banners hiding them.

What AuditX checks

The scan opens the page you scanned in a browser at desktop size (1440 by 900 pixels) and presses the Tab key like a keyboard user. It does not click or open any menu. It allows 3 presses per focusable element, with a minimum of 6 and a maximum of 60. It tests up to 8 sample elements spread over the part of the tab order it reaches. Each time a sample element gets focus, the scan tests 9 points on it, in a grid at 15, 50 and 85 percent across and down, and asks the browser what is painted on top at each point. A point counts as covered when the top item is a fixed or sticky element (at least 3 percent of the screen, up to 20 of them) that does not contain the focused element. A sample counts as obscured when more than half of its tested points are covered. A sample inside a menu that is only faded out is left to the check on the visible focus indicator. The report names the covered elements and the layer on top of them. The check fails when at least one sample is obscured. The message differs when all of them sit behind one large layer of at least 60 percent of the screen, such as a cookie wall. It passes when none is. The result is an info note, which does not lower the score, when there is nothing focusable, when no element could be sampled, or when the page could not be measured, in which case it is marked as not measured. Elements that the scan had to focus by script, because a trap stopped the Tab walk, are left out. This is stricter than WCAG 2.4.11, which only fails when the focused item is entirely hidden. The scan sees the page as loaded and does not scroll further or open menus. A fail costs points, and the count of obscured samples raises its weight.

Why it matters

W3C WCAG 2.4.11 (Focus Not Obscured, Minimum, level AA) says the item that has keyboard focus must not be entirely hidden by author-created content, and names sticky headers, sticky footers and non-modal dialogs as typical causes. When people cannot see the focused item they may not know how to proceed.

The same W3C page explains that sighted people who use a keyboard, a switch or voice input rely on seeing the point of focus, so a hidden focus looks like a page that has stopped responding.

How to fix it

  1. Add scroll-margin-top (or scroll-padding-top on the html element) that is at least as tall as your sticky header, so a focused item scrolls into view below it.
  2. Keep sticky bars as short as you can, especially on small screens, and do not stack several of them.
  3. For a cookie banner or other dialog that covers the page, move focus into it when it opens and keep focus there until it is closed, or mark the page behind it as inert.
  4. Tab through your own page with a sticky header showing, and check that every focused link and button stays in view.
html { scroll-padding-top: 80px; }
:target, a, button, input { scroll-margin-top: 80px; }

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.