- Level
- AA
- Since
- WCAG 2.2
- Entries
- 52 / 193
2.4.11 Focus Not Obscured (Minimum)
When an element receives keyboard focus, it must not be completely hidden behind something the page puts on top of it, such as a sticky header or a cookie banner.
/ What it requires
Sticky headers, fixed footers, cookie banners and chat widgets stay in place while the page scrolls beneath them. When a keyboard user tabs to a link that the browser has scrolled under one of them, the link has focus and its indicator is drawn, but nobody can see it. The user keeps pressing Tab with no idea where they are. People who rely on a keyboard and on their eyes, and people using magnification, are the ones stopped.
The criterion fails only when the focused component is entirely hidden by content the author created. A component that is partly covered passes at this level, and the AAA criterion 2.4.12 requires that no part is hidden. WCAG adds notes: where users can move content around, only its initial position counts, content the user opened may cover the focus, and if the covering content can be dismissed without moving focus, for example with Escape, the component is not considered hidden.
This criterion is new in WCAG 2.2 and is not part of WCAG 2.0 or 2.1.
/ How pages fail it
- A sticky header covers links near the top of the viewport when the user tabs backwards with Shift+Tab.
- A fixed footer bar covers controls at the bottom of the viewport as the user tabs forward.
- A cookie banner that does not hold focus sits over the page while focus moves through the links beneath it.
- A chat widget or floating promotion pinned to a corner sits on top of the submit button of a form.
- A sticky table header or sidebar hides the focused cell or link in the scrolling area under it.
/ How to check it yourself
- Load the page fresh, leave any cookie banner open, and press Tab through the whole page. At each stop check that at least part of the focused element is visible.
- At the bottom, go back up with Shift+Tab. Sticky headers hide focus most often in this direction.
- Repeat in a small window or with the browser zoomed in, where pinned bars take up more of the viewport.
- When focus disappears, type document.activeElement in the DevTools console and inspect the element to see what is painted over it.
/ How to fix it
- Set scroll-padding-top on the html element to the height of the sticky header, and scroll-padding-bottom for a fixed footer, so the browser stops scrolling before the focused element goes under the bar.
- Or set scroll-margin-top and scroll-margin-bottom on the focusable elements themselves.
- Make the cookie banner part of the page flow so it pushes content down, or build it as a modal dialog that holds focus until it is answered.
- Unpin bars at small viewport heights with a media query that switches position: sticky to position: static.
- Move chat widgets and floating buttons away from form controls, and let users close them with a button and with Escape.
/ What our scanner checks
The check focus-obscured runs in a real browser. It focuses up to 80 tab stops, lets the browser scroll to each, then asks what is painted at three points: the two top corners and the centre. If at least two are covered by something with position fixed or sticky, it reports the stop. It cannot tell whether the covering content can be dismissed and may flag a partly covered element.
/ Who fails it, in our own measurements
One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.
/ Questions about this criterion
Does a sticky header fail WCAG 2.2?
Not by existing. It fails 2.4.11 when a component that receives keyboard focus ends up entirely hidden behind it. If the browser keeps the focused element clear of the header, which scroll-padding-top achieves, a sticky header passes. Test by tabbing backwards up the page, because that is when elements slide under a header.
Is a partly hidden focused element a failure?
Not at level AA. 2.4.11 is the minimum version and fails only when the component is entirely hidden. 2.4.12 Focus Not Obscured (Enhanced), at level AAA, requires that no part of the component is hidden. Partly covered focus is still hard to use, so it is worth fixing with the same scroll-padding change.
Does a cookie banner fail 2.4.11?
It can. A banner pinned to the bottom of the viewport that stays open while focus moves through the page beneath it will cover some focused elements completely. A banner built as a modal dialog that keeps focus inside until the user answers does not, and neither does one that pushes the page content down instead of covering it.
