Visible focus
Keyboard users need to see where they are, and a hidden or covered focus indicator leaves them lost.
The answer
Always show where keyboard focus is, and never cover it. As strong as the weakest rule behind it: settled.
-
Show where keyboard focus is on everything that works by keyboard.
WCAG 2.2 success criterion 2.4.7 Focus Visible, level AA. Removing the indicator by styling, or removing focus by script, are listed failures.
- Applies when
- Any keyboard-operable interface.
- Based on
- Standard or law
- Principle
- Work for everyone
- StandardStandard: Understanding SC 2.4.7 Focus Visible (Level AA)W3C WAI
-
Don’t let sticky bars, banners or other layers completely hide the focused control.
WCAG 2.2 success criterion 2.4.11, level AA. See Focus management on open and close.
- Applies when
- Fixed or overlaid content.
- Based on
- Standard or law
- Principle
- Work for everyone
- Common mistake
- A cookie banner that sits over the focused link.
- StandardStandard: Understanding SC 2.4.11: Focus Not Obscured (Minimum)W3C WAI
The other rules
-
If you remove the browser’s focus indicator, add your own that stays as long as focus does.
Same criterion: the browser default is sufficient, and removing it without replacement is failure F78.
- Applies when
- Custom styling of focus.
- Based on
- Standard or law
- Principle
- Work for everyone
- Common mistake
- Removing the outline with nothing in its place.
- Common mistake
- An indicator that flashes and disappears.
- StandardStandard: Understanding SC 2.4.7 Focus Visible (Level AA)W3C WAI
- GuidanceGuidance: Keyboard Accessibility (WebAIM techniques)WebAIM, 2026
-
You may show the indicator only for keyboard use. It isn’t needed after a mouse click.
WCAG says an indicator for pointer users is not normatively required. The selectors specification suggests browsers show focus for keyboard navigation and on text fields, and not when a pointer focuses a control that takes no typing. Suggested browser behavior, so no floor.
- Applies when
- Deciding when focus shows.
- Based on
- Standard or law
- Principle
- Be consistent
- StandardsStandard: Understanding SC 2.4.7 Focus Visible (Level AA)W3C WAI
- Standard: Selectors Level 4, the :focus-visible pseudo-class (Working Draft)W3C CSS Working Group, 2026
- GuidanceGuidance: :focus-visible (MDN Web Docs)Mozilla, 2026
-
When a script moves focus, show the indicator on the new element if it was showing before, and on anything that takes focus as it appears.
Advisory wording in a specification still in progress; browser documentation leaves it to browser judgment.
- Applies when
- Script-managed focus.
- Based on
- Standard or law
- Principle
- Be consistent
- StandardStandard: Selectors Level 4, the :focus-visible pseudo-class (Working Draft)W3C CSS Working Group, 2026
- GuidanceGuidance: :focus-visible (MDN Web Docs)Mozilla, 2026
Accessibility
Open questions
- OpenDo sighted keyboard users lose their place without an indicator, and how often? The standard says so; no study was found.
- OpenDoes an indicator that appears only for keyboard use confuse people who switch between mouse and keyboard? Asserted in browser documentation, not tested.
Sources
- StandardsStandard: Understanding SC 2.4.7 Focus Visible (Level AA)W3C WAI
- Standard: Understanding SC 2.4.11: Focus Not Obscured (Minimum)W3C WAI
- Standard: Selectors Level 4, the :focus-visible pseudo-class (Working Draft)W3C CSS Working Group, 2026
- GuidanceGuidance: Keyboard Accessibility (WebAIM techniques)WebAIM, 2026
- Guidance: :focus-visible (MDN Web Docs)Mozilla, 2026
Related
- Keyboard operationMake everything work from the keyboard, in a sensible order, with the keys people expect.Answer: moderate.
- Focus management on open and closeMove focus into a dialog when it opens, and back to the control that opened it when it closes.Answer: moderate.
- Skip linksGive keyboard users a way past repeated blocks: a skip link first in the focus order, and a heading for each section.Answer: moderate.