WCAG Encyclopedia

2.4.11 · OperableLevel AANew in 2.2

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.

Broken: The sticky header covers the field that just took focus.
Sticky headerFocused field, underneathNext field

The browser scrolled the field into view, then the header covered it. The reader is typing into something they cannot see.

Fixed: Scroll padding reserves room for the header.
Sticky headerFocused field, clear of itNext field

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.

Markup diff — app.css
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.

Sticky header
EmailAddress line 1Address line 2CityPostcode

scroll-padding-top: none

CaptionA long form under a sticky header.
0:00 / 0:12CC onSilent · looping

How to test

Check your own interface against 2.4.11, one step at a time.

  1. List everything the page keeps on screen while it scrolls: sticky headers and footers, cookie banners, chat buttons, toolbars.
  2. 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.
  3. 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.
  4. 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

  1. Goal. Keep a sticky banner from hiding the field that has focus.
  2. 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.
  3. 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.
  4. 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

Clear of the banner

2.4.11 passes

Also in guideline 2.4

Criteria in the same guideline often fail together.