Level AA
What the automated checks look for
Controls show no focus indicator
Nothing shows when this control has keyboard focus, so keyboard users can't see where they are.
Who it affects. People who use a keyboard can't see which control has focus, so they press Enter without knowing what it will do.
How to fix it. Don't remove the focus outline. If you restyle it, use :focus-visible with an outline that contrasts with the background.
<style>button:focus-visible { outline: 3px solid #1a4fd6; outline-offset: 2px; }</style>Read more
- Understanding 2.4.7, from the W3C
- Accessible components, with code to copy, our guide to building dialogs, menus and forms that meet it
- Read and write an accessibility conformance report, our guide to how a criterion’s row is set
- Previous: 2.4.6 Headings and Labels
- Next: 2.4.11 Focus Not Obscured (Minimum)