# Focus Not Obscured

> The Focus Not Obscured WCAG success criterion requires that a focused element is not hidden by other content.

## How do I stop a sticky header from hiding the focused element?

The success criterion that requires a focused element not to be entirely hidden by author-created content like sticky headers, cookie banners or chat widgets. Level AA requires it to be at least partially visible.

- Topic: WCAG 2.2
- Type: concept

## Example

Wrong:

```css
.site-header {
  position: sticky;
  top: 0;
  height: 64px;
}
```

Right:

```css
html {
  scroll-padding-top: 72px;
}
.site-header {
  position: sticky;
  top: 0;
  height: 64px;
}
```

`scroll-padding-top` makes the browser scroll focused elements below the sticky header instead of behind it.

## Common mistakes

- Tabbing through a page where links are hidden behind a fixed header.

## Key points

- Pages with a sticky header or footer set `scroll-padding` to at least the header height.
- Cookie banners and chat widgets do not cover focused elements, or close when focus moves under them.
- Non-modal overlays do not sit on top of content the keyboard can still reach.

## Interview questions

### What is the difference between Focus Not Obscured Minimum and Enhanced?

Minimum, at level AA, allows the focused element to be partly covered. Enhanced, at level AAA, requires it to be fully visible.

### Do modal dialogs fail Focus Not Obscured?

No, as long as focus stays inside the modal, because the content behind it cannot receive focus.

## Related cards

- [scroll-padding](https://wonderium.dev/css/scroll-padding.md)
- [position](https://wonderium.dev/css/position.md)
- [Focus Appearance](https://wonderium.dev/a11y/focus-appearance.md)
- [:focus-visible](https://wonderium.dev/css/focus-visible.md)
- [WCAG 2.2](https://wonderium.dev/a11y/wcag-2-2.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/focus-not-obscured
- Last updated: 2026-11-25
