Focus Not Obscured: The Sticky Bar That Swallows Keyboard Focus at Checkout

What 2.4.11 actually requires

WCAG 2.2, published as a W3C Recommendation on 5 October 2023, added success criterion 2.4.11 Focus Not Obscured (Minimum) at Level AA. When a component receives keyboard focus, it must not be entirely hidden by author created content. Partially covered passes at AA; fully covered fails. The stricter 2.4.12, at AAA, allows no part of the focused element to be hidden.

Checkout is where this fails in production. A sticky order summary bar sits at the bottom of the viewport, a cookie banner sits on top of it, and the keyboard user tabs to the place order button, which the browser scrolls to the very bottom edge, directly underneath both. Focus exists. The user cannot see it.

Related reading on this site: Quantity Steppers Fail WCAG Target Size More Than Any Other Checkout Control, Redundant Entry: Your Checkout Asks for the Same Address Twice and Calls It Normal.

The fix is one CSS property

scroll-margin-top and scroll-margin-bottom on focusable elements tell the browser to leave a gap when it scrolls an element into view. Set the bottom margin to the combined height of your sticky bar and banner and the focused control lands clear of both. TestParty's WCAG 2.2 guidance gives the same pattern for headers using a CSS variable for the sticky height.

What does not fix it: removing the sticky bar for everyone, which punishes mobile shoppers for a keyboard defect, or adding a visible focus outline, which solves 2.4.7 Focus Visible while the outlined element stays hidden under the bar. The criteria are separate because the failures are separate.

How to test it in ten minutes

Unplug the mouse. Tab through the checkout on a short viewport, a laptop at 125 percent zoom reproduces the geometry well, and note every stop where the focused element is fully covered. Banners that appear after a delay are the worst offenders, because the focus was visible when it landed and the banner arrived over it.

WebAIM's guidance and checklist remain the working reference most practitioners test against, and their Million report keeps finding focus and contrast failures among the most common on home pages. A checkout that passes 2.4.11 has usually been tabbed through by a human. There is no scanner shortcut for geometry that changes when a banner loads late.

Frequently asked questions

What is WCAG 2.4.11 Focus Not Obscured?

A Level AA criterion added in WCAG 2.2 requiring that when an element receives keyboard focus, it is not entirely hidden by author created content such as sticky headers, bars or banners.

How do you fix a focused element hidden under a sticky bar?

Add scroll-margin to focusable elements, sized to the height of the sticky content, so the browser scrolls the focused element into view clear of the bar or banner.

Is a visible focus outline enough to pass?

No. A focus outline addresses 2.4.7 Focus Visible. If the outlined element sits completely under a sticky bar, 2.4.11 still fails, because the user cannot see the indicator at all.