JOURNAL / PRODUCT DESIGN / ACCESSIBILITY

A sticky header should never sit on top of the focus

Sticky headers, cookie banners and chat launchers can hide the element a keyboard user just reached. What WCAG 2.2 Focus Not Obscured asks, and the layout patterns that keep persistent UI.

· 6 MIN READ · Blanche Agency
Engraving-style ink illustration on pale lemon of an open blank notebook with a heavy wooden ruler laid across it, half covering a small brass thumbtack.
Original AI-created conceptual illustration; exact Blanche logo composed separately. · Blanche Agency · aiBLANCHE / 2026

INTRODUCTION

A sticky header keeps navigation in reach. A cookie banner keeps the legal team calm. A chat launcher keeps sales close. Each is a reasonable decision on its own. Together they can produce a page where someone moving through it with a keyboard presses Tab and the thing they just landed on is underneath a layer of your own interface.

This piece is for founders, product leads and designers who decide what stays pinned to the screen. It explains what WCAG 2.2 now asks, why the failure matters more than it looks, and which layout patterns avoid it without giving up persistent UI.

What the standard asks

WCAG 2.2 added two related success criteria. 2.4.11 Focus Not Obscured (Minimum), at Level AA, says that when a component receives keyboard focus, it is not entirely hidden by author-created content. 2.4.12 Focus Not Obscured (Enhanced), at Level AAA, raises the bar: no part of the component may be hidden.

The W3C’s explanation names the usual suspects directly: sticky headers, sticky footers and non-modal dialogs. It also names the cookie banner. A banner that fully covers a focused component fails the AA criterion; one that covers it partly fails AAA.

Two details matter for product teams. First, the test is about the focused component itself, not only its focus ring; a ring hidden behind a bar while the button peeks out may still fail the separate Focus Visible criterion. Second, the AA criterion tolerates partial overlap as a concession to complex responsive layouts, and the W3C text still tells authors to reduce how often and how much that happens.

Why a hidden focus is worse than it looks

Focus is the only “you are here” marker for sighted people who use a keyboard, a switch device or voice control that drives the keyboard interface. The W3C notes that when they cannot see the focused item they may not know how to proceed, or may think the system has stopped responding.

The failure is also easy to miss in review. A designer checks a static frame with nothing focused. A developer tabs through on a wide monitor where the header covers nothing important. The problem appears for someone at 200% zoom on a laptop, or on a narrow screen where a 64-pixel header and a 90-pixel cookie bar leave a slim strip of visible page. Browsers scroll a newly focused element into view, but they do not know your header is there unless you tell them.

Patterns that pass

The W3C guidance and current CSS give you several options. Choose by how persistent the layer has to be.

  • Reserve the space. scroll-padding-top tells the browser that part of the scroll container is obscured, so focus and anchor scrolling place targets below a fixed header. Set it, with scroll-padding-bottom, to the real height of your fixed bars. MDN lists it as widely available across browsers since April 2021.

  • Reflow instead of overlap. When a side panel or accordion opens, let it push or narrow the main content rather than float over it. Nothing can be hidden underneath content that does not overlap.

  • Make blocking messages modal. The W3C suggests a cookie banner can pass by being modal: focus moves into it and stays there until it is dismissed. Alternatively, give it reserved space so it never covers the page.

  • Let people dismiss without hunting. For content a person opens themselves, such as a chat window, the criterion allows a way to reveal the focused item without moving focus back, such as closing it with Escape or scrolling. Non-persistent pieces like menus and tooltips should close when focus leaves them.

  • Use the empty margin. Toasts and chat panels that slide into unused space at each breakpoint do not collide with operable content.

The counterargument: persistent UI earns its place

The serious objection is that sticky elements exist for good reasons. A pinned checkout button keeps the main action in reach on long product pages; a visible header saves people from scrolling back up; a support launcher can answer a question before it turns into an abandoned cart. Making everything modal or removing it would be its own usability failure.

The standard does not ask for that. It asks that persistent layers be sized and positioned so the page beneath them can still be navigated. The cost is mostly engineering discipline: measured heights, scroll padding that updates when a banner appears, and a test step. The decision worth making explicitly is how many layers you pin at once on small screens, because each one shrinks the space where focus can be seen.

A worked example (hypothetical)

Imagine a shop with a 72-pixel sticky header, a 96-pixel cookie banner pinned to the bottom until consent, and a 56-pixel “Add to basket” bar on product pages. On a phone in landscape, roughly 360 pixels tall, that leaves about 136 pixels of page. Tabbing through the size selector, focus lands on options under the basket bar and under the cookie banner.

The team sets scroll padding at the top and bottom from the measured bar heights, updating it when the banner opens and closes. The banner becomes dismissible with Escape and takes focus on first load. On short viewports the basket bar hides until the size is chosen. Nothing visible is removed; the page simply stops putting its own furniture on top of the person’s place.

A test you can run this week

Pick the three pages with the most traffic. At 320 pixels wide and at 200% browser zoom, open every banner and launcher you show to new visitors, then tab from the top to the bottom of each page. Note every stop where you cannot see the focused element. Fix the layer, not the element. If you are reviewing interaction patterns at the same time, our pieces on alternatives to dragging and session timeouts cover two other WCAG 2.2-era decisions that tend to surface in the same audit.

Sources checked on 24 November 2026: W3C Understanding documents for WCAG 2.2 success criteria 2.4.11 and 2.4.12, and MDN Web Docs for scroll-padding-top.

KEEP THINKING

Keep reading.

More ideas on building better brands and digital products.

Product design

A name field should fit the name, not the database

Product design

Pages, “load more” or infinite scroll: decide by what people do next

View all articles