2.4.7 Focus Visible
Level AA Since WCAG 2.0 How it is checked: Robot
In plain language
When using the keyboard, the element that has focus must be clearly visible, usually with an outline around it.
Who is affected
- People with motor disabilities using only a keyboard
- People with low vision
Examples
Fails
*:focus { outline: none; } /* removes the focus outline with nothing to replace it */Passes
:focus-visible { outline: 3px solid #0a4fa3; outline-offset: 2px; }How to fix
- Do not remove the outline unless you provide another focus style.
- Use :focus-visible so the outline only shows for keyboard users.
- Make the outline thick enough (≥ 2px) and high-contrast enough.
How to test it yourself
- Tab through the page: do you always know where you are? (the WCAG.win report flags "focus outline not visible")
What WCAG.win checks
WCAG.win checks part of this criterion automatically. The rest still needs a person.
- Robot: Takes a screenshot at every Tab step and compares it with the unfocused state to find missing focus indicators.
W3C documentation: Understanding Success Criterion 2.4.7: Focus Visible