Focus Not Obscured (Minimum)
When something receives focus, it must not be entirely hidden behind other content. New in WCAG 2.2, and almost always caused by a sticky header swallowing whatever you just tabbed to.
- Principle
- Operable
- Guideline
- 2.4
- Level
- AA
- In WCAG since
- 2.2
- Number
- 2.4.11
Broken, then fixed
The same interface twice: first with the mistake, then with the smallest change that fixes it.
The sticky header covers the field that just took focus.
The browser scrolled the field into view, then the header covered it. The reader is typing into something they cannot see.
Scroll padding reserves room for the header.
scroll-padding-top equal to the header height, set once on the root.
What changed in the code
The fix as a diff: removed lines are marked with a minus, added lines with a plus.
html {
added: scroll-padding-top: 5.5rem; /* the sticky header */
}
One declaration fixes anchor jumps, tab traversal, and programmatic scrolling all at once, because they all honour scroll padding.
Watch it happen
This demo plays the failure out over time. It is silent and captioned, and you can pause or scrub at any point.
scroll-padding-top: none
How to test
Check your own interface against 2.4.11, one step at a time.
- List everything the page keeps on screen while it scrolls: sticky headers and footers, cookie banners, chat buttons, toolbars.
- Click in the address bar and press Tab through the whole page, then Shift+Tab back. At each stop, check that some part of the focused element is still in view and not covered.
- Repeat at a narrow window width, around 320 pixels, and with the page zoomed to 200%, where sticky bars take up more of the screen.
- Open any content that stays open as focus moves, such as a chat window or a non-modal dialog. Tab past it and check that it never covers the focused element completely, or that Escape closes it without moving focus.
Common questions
Does focus that is partly covered fail 2.4.11?
No. At Level AA, the focused element fails only when it is hidden entirely. Hiding none of it is what 2.4.12 Focus Not Obscured (Enhanced), at Level AAA, asks for.
Does a cookie banner that covers the bottom of the page fail 2.4.11?
Only when it can hide a focused element completely. It passes if it is modal, so the person deals with it first, or if the page reserves space for it with scroll-padding so focused content scrolls clear of it.
Does a drop-down menu that covers focused content fail 2.4.11?
No, when it closes as soon as focus moves away from it. Content that stays open, such as a chat window, fails if it can hide the focused element and the person cannot get it out of the way without moving focus.
Try it yourself
A lab is a small working piece of interface that you change yourself. Read its steps, use the controls under it, and watch the verdict line at the bottom: it says whether the criterion passes or fails as you go. Reset puts it back.
Try it: move the sticky banner
How to use this lab
- Goal. Keep a sticky banner from hiding the field that has focus.
- The controls. The Banner position slider moves the banner down the mock window, from the top to 160 pixels down. The Banner height slider makes it taller or shorter. The readout under “The focused field” says how much of the field the banner covers.
- Try this. Drag Banner position to 70 pixels, so the banner sits over the field. Then drag Banner height below 40px, and back up to 40px or more.
- What it means. 2.4.11 passes while any of the focused field is in view, even when part of it is hidden. It fails when the banner hides the field completely, because keyboard users can’t see where focus has gone. The verdict line under the lab says which.
The focused field
2.4.11 passes
Also in guideline 2.4
Criteria in the same guideline often fail together.
- 2.4.1, OperableLevel A
Bypass Blocks
Fails when: Every menu link stands between the reader and the article.
- 2.4.2, OperableLevel A
Page Titled
Fails when: The same title on every page.
- 2.4.3, OperableLevel A
Focus Order
Fails when: A dialog opens and focus stays behind it.
- 2.4.4, OperableLevel A
Link Purpose (In Context)
Fails when: Three “read more” links, with their titles in a separate column.
- 2.4.5, OperableLevel AA
Multiple Ways
Fails when: A deep hierarchy and nothing else.
- 2.4.6, OperableLevel AA
Headings and Labels
Fails when: Headings that describe nothing.