The outline browsers draw around a focused button or link is not decoration - it is the basic location indicator for keyboard users. CSS that disables it (outline: none) effectively makes the cursor invisible.
Why this matters
The historical reset *:focus { outline: none; } was popular to remove browsers' default blue ring. The cost: every keyboard interaction breaks. A user pressing Tab to move between links and buttons has no idea where they are at any given moment. Blind users combining keyboard and screen reader, motor-impaired users on trackballs, power users who navigate by keyboard - all are locked out.
This is an explicit international accessibility guidelines Level AA requirement, 2.4.7 Focus Visible. Since Safari 15.4 and Chrome 86, :focus-visible is widely supported - a pseudo-class that activates only when focus arrived via keyboard, not from a mouse click. It solves the cosmetic complaint about a ring after clicking a button.
How to detect
Open the site and press Tab repeatedly. If you cannot see a frame or highlight on the current link/button, there is a problem. Search the CSS:
grep -rn "outline:\s*none\|outline:\s*0" wp-content/themes/ wp-content/plugins/Look for outline: none or outline: 0 on :focus. Tooling: axe DevTools reports "Element does not have visible focus indicator."
How to fix
- If you found
outline: nonein the theme'sstyle.css- do not delete it. Add the following rule alongside:
This means "remove outline on mouse click, but show a clear ring when arriving via keyboard.":focus { outline: none; } :focus-visible { outline: 2px solid #0066cc; outline-offset: 2px; border-radius: 2px; } - Use a high-contrast colour - at least 3:1 against the background. Check with the WebAIM Contrast Checker.
- Add
outline-offset: 2px- a small gap from the element makes the focus ring more obvious. - Watch for aggressive plugin resets - some plugins set focus styles globally. Place your CSS after they load (child theme or a late-loading hook).
- In the block editor, the CSS also applies to the admin side if enqueued via
admin_enqueue_scripts. - Verify on all element types: nav links, CTA buttons, form fields, mobile hamburger menu.
Common mistakes
- Using
:focusalone without:focus-visible: mouse clicks now also draw the ring, which feels odd. Use both. - An outline colour that disappears against the background:
outline: 1px solid #dddon grey - invisible. Check contrast. - Replacing outline with box-shadow without testing:
:focus { box-shadow: 0 0 0 2px blue; }works but not in every browser. If used, keepoutline-offset: 0as fallback. - Styling only
button: keyboard users also reacha,input,select,summary. Style all of them.
Verifying the fix
Open the site and Tab through the home page. Every Tab stop should reveal a clear ring. Test internal pages, forms and menus too. Run axe DevTools - the Focus Visible category should pass. RankPlus turns green.
outline: 0 on their own. Add your CSS via Customiser > Additional CSS - it loads after the page builder and overrides cleanly. Test focus indicators on a wide range of interactive elements: primary nav links, mobile hamburger menu, accordion expand/collapse, select dropdown, checkbox and radio inputs in forms. Each can manage focus differently. Also be cautious with CSS that uses :focus-within to style open panels - combined with :focus { outline: none }, it can create hidden focus regions that are technically focused but invisible. Use a Tab Visualiser browser extension to map the actual tab order through the page - sometimes the order skips around in surprising ways even sighted users find disorienting.