Free scan

October 25, 2026

Focus Not Obscured: Sticky Header and Cookie Banner Fixes (WCAG 2.4.11)

If your sticky header completely hides the link a keyboard user just tabbed to, you have a focus not obscured problem. Success Criterion 2.4.11 Focus Not Obscured (Minimum), at Level AA, requires that when a user interface component receives keyboard focus, it is not entirely hidden by author-created content. In practice: while someone navigates with the keyboard, the focused element must stay at least partially visible. The typical cases the W3C names are sticky headers, sticky footers and non-modal dialogs; a sticky cookie banner can also fail the criterion. The W3C lists one sufficient technique, CSS scroll-padding (technique C43), and one documented failure: a sticky footer or header completely hiding focused elements (failure F110). Here is how to reason about it, test it and fix it.

What WCAG 2.4.11 Focus Not Obscured actually requires

The normative text is short: when a user interface component receives keyboard focus, the component is not entirely hidden due to author-created content. The key word is "entirely": at Level AA, a partly covered component can pass. The W3C explains this allowance by the complexity of today's responsive designs, while noting that the more of a component is obscured, the less easy it is to see. Authors should therefore try to reduce how much and how often the focused item is partly obscured.

The ideal outcome, no overlap at all, is covered by a separate Level AAA criterion: Focus Not Obscured (Enhanced). Treat Level AA as a floor, not a goal.

The criterion evaluates the focused component, not the focus indicator. The indicator only counts if it sits inside the component, or if focus is shown by a change to the component itself. The W3C says this gives a clearer metric, but a fully obscured focus indicator would likely fail 2.4.7 Focus Visible.

Focus not obscured: why a sticky header or cookie banner can hide focus

The W3C names sticky footers, sticky headers and non-modal dialogs as typical types of content that can overlap focused items: as a user tabs through the page, these layers can obscure the item receiving focus, along with its focus indicator.

The W3C explicitly names cookie banners as an example. A notification implemented as sticky content, such as a cookie banner, fails this criterion if it entirely obscures a component receiving focus. For sighted people who rely on a keyboard, or on a device that operates through the keyboard interface such as a switch or voice input, knowing where focus is matters a great deal: without seeing it, they may not know how to proceed, or may even think the system has become unresponsive.

Semi-transparent, blurred or dimming overlays deserve attention too. Because these overlays may not entirely obscure the focused item, it can pass 2.4.11, but it may separately fail 1.4.11 Non-text Contrast: the focus indicator must be evaluated against the contrast requirements of 1.4.11 as it appears under the overlay.

Fixing it with scroll-padding (CSS technique C43)

The sufficient technique the W3C lists for this criterion is C43: using CSS scroll-padding to un-obscure content. The W3C example: on a page with a sticky footer, the focused item is not completely obscured because content in the viewport scrolls up to always display the item with keyboard focus, using scroll padding. The W3C also mentions scroll padding for banners, so the banner does not overlap other content.

The snippet below is our own illustration, to adapt: the W3C Understanding page cites technique C43 without detailing its syntax. We set scroll-padding to a value matching the height of each sticky bar; check the result with the keyboard at every breakpoint.

/* Illustration: reserve room for the sticky header and footer */
html {
  scroll-padding-top: 5rem;    /* sticky header height */
  scroll-padding-bottom: 4rem; /* sticky footer height */
}

.site-header {
  position: sticky;
  top: 0;
}

/* Keyboard-visible focus indicator (technique C45) */
a:focus-visible,
button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

Cookie banners and notifications: other ways to pass

Scroll-padding is not the only route. For a cookie banner or sticky notification, the W3C describes several ways of passing:

Persistent content opened by the user

For persistent content the user opens themselves, such as an accordion, a chatbot or expandable side navigation, the W3C describes approaches that avoid obscuring focus:

How it relates to Focus Visible (2.4.7)

Success Criterion 2.4.7 Focus Visible, also Level AA, requires that any keyboard operable user interface has a mode of operation where the keyboard focus indicator is visible. Its purpose is to help people know which element has keyboard focus. The W3C adds that the indicator must not be time limited: once shown, it must remain visible.

The two criteria work together. 2.4.7 checks that the focus indicator is visible in at least one mode of operation; 2.4.11 checks that the focused component is not entirely hidden by author-created content. A perfectly styled focus ring is useless if it vanishes under a sticky header. Sufficient techniques for 2.4.7 include C15 (using CSS to change a component's presentation on focus), C40 (a two-color indicator for sufficient contrast) and C45 (using :focus-visible). Among its failures, F78 covers outline or border styles that remove or render the focus indicator non-visible, and F55 covers script that removes focus when it is received.

Testing focus not obscured on your site

A manual keyboard test lets you check this criterion. Go through each page template using only the keyboard, with Tab and Shift+Tab, watching at each step whether the focused element stays visible.

Frequently asked questions

What is WCAG 2.4.11 Focus Not Obscured?

A Level AA criterion: when a user interface component receives keyboard focus, it must not be entirely hidden by author-created content, such as a sticky header or a banner.

Does a partially hidden focused element pass?

At Level AA, yes: 2.4.11 allows partial overlap. The AAA criterion Focus Not Obscured (Enhanced) targets no overlap at all, and the W3C recommends trying to reduce how much and how often the focused item is partly obscured.

How do I stop a sticky header from hiding focus?

The sufficient technique cited by the W3C is C43: use CSS scroll-padding so content scrolls and the focused element is not completely obscured by the sticky bar. The W3C example uses a sticky footer.

Can a cookie banner fail WCAG 2.4.11?

Yes, if it entirely obscures a component receiving focus. Ways to pass include making it modal, using scroll padding, or, if it requires no action, closing it when it loses focus.

What is the difference between Focus Visible and Focus Not Obscured?

2.4.7 requires a mode of operation in which the keyboard focus indicator is visible; 2.4.11 requires that the focused component is not entirely hidden by author-created content. A fully hidden indicator would likely also fail 2.4.7.

Further reading on Conformly

Sources

This article relies on the official sources listed at the end of the page.