Rule

Unobscured focus

Focused elements must not be fully hidden behind overlays.

Rule
focus-not-obscured
WCAG 2.2
2.4.11 Focus Not Obscured (Minimum) (opens in a new tab) (Level AA)
Severity
Serious

What it checks

Looks at focusable elements inside the viewport and asks what paints above the centre of each. When an opaque panel that is fixed or sticky, at least 40 by 24 pixels, covers the whole element, the element is reported. An element only partly covered passes, since the criterion forbids focus being entirely hidden.

Nothing is reported while a dialog is open, as the page behind it is meant to be covered. A page passes when its scrolling element sets scroll-padding on the edge the panel sits on, at least as deep as the panel, since that keeps the browser from scrolling focus underneath it.

When a person decides

Findings are always sent for review. What sits under a panel depends on the scroll position at the moment of the audit, and whether focus ever lands there depends on the tab order and on how the page scrolls. A person tabs through the page and checks the focus indicator is never hidden.

Example

Sent to review

<style>
  body { margin: 0; }
  .story { height: 540px; }
  .consent { position: fixed; bottom: 0; left: 0; right: 0; height: 100px; background: #fff; }
</style>
<div class="story"></div>
<a href="/privacy/">Privacy notice</a>
<div class="consent">This site uses cookies.</div>

Passes

<style>
  html { scroll-padding-bottom: 100px; }
  body { margin: 0; }
  .story { height: 540px; }
  .consent { position: fixed; bottom: 0; left: 0; right: 0; height: 100px; background: #fff; }
</style>
<div class="story"></div>
<a href="/privacy/">Privacy notice</a>
<div class="consent">This site uses cookies.</div>

The engine is tested against both examples.

How to fix it

Reserve room for the panel with scroll-padding-bottom or scroll-padding-top on the scrolling element, as deep as the panel, so the browser scrolls focused elements clear of it. Or move focus clear of the panel while it is showing.

Check your own pages

This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.