Who Removed the Focus Ring? Five Mistakes With outline and :focus-visible
Short answer: If your stylesheet contains outline: none or outline: 0 on links, buttons or inputs without a replacement, anyone who navigates with a keyboard cannot see where they are. The modern approach is to remove nothing globally, style :focus-visible instead, and make the indicator clearly visible against every background it appears on. Browsers show :focus-visible mainly for keyboard focus, so mouse users do not see a ring on every click, which was the usual reason designers hid it.
Why the outline gets removed
Someone on the team clicks a button, sees an ugly blue or black ring, and adds * { outline: none; } to the reset. The page looks cleaner. Months later a visitor presses Tab to move through your menu and nothing shows which link is active. Keyboard users include people with motor impairments, people with a broken wrist, power users, and anyone whose trackpad has died. Screen magnifier users also rely on the ring to track position.
The fix is not to bring back the ugly default everywhere. It is to design the ring on purpose. Here are five mistakes that cause the problem and what to do about each.
Mistake 1: a global reset with no replacement
/* problem */
a, button, input { outline: none; }
Fix: delete it. If you must change the default, replace rather than remove:
:focus-visible {
outline: 3px solid #1a56db;
outline-offset: 3px;
}
This one rule gives every focusable element a consistent indicator. Then refine for special cases such as dark sections.
Mistake 2: using :focus when you mean :focus-visible
Styling :focus shows the ring on mouse click too, which is what annoyed people to begin with. :focus-visible matches when the browser decides a visible indicator is helpful, typically after keyboard use, and for text inputs always. As of November 2026 it is supported in all current major browsers. If you need to support an older browser, keep a plain :focus rule first and then cancel it for mouse users with :focus:not(:focus-visible).
Mistake 3: a ring with too little contrast
A light grey ring on a white page, or a brand blue ring on a dark blue header, can be technically present and practically invisible. WCAG 2.2 asks for a focus indicator that is clearly distinguishable, and its related success criteria discuss contrast of at least 3 to 1 against adjacent colours. Test it against each background. A two-colour approach survives mixed backgrounds:
:focus-visible {
outline: 2px solid #ffffff;
box-shadow: 0 0 0 5px #111111;
}
The white inner line and dark outer band guarantee one of them contrasts, whether the element sits on a pale or dark section. Note that box-shadow is hidden in Windows forced colours mode, so keep a real outline as well.
Mistake 4: the ring is clipped
An element inside a container with overflow: hidden, such as a card, a carousel or an image wrapper, can have its outline cut off at the edge. Symptoms: only three sides of the ring show. Fixes include a negative outline-offset so the ring sits inside the element, adding padding to the container, or moving overflow: hidden to an inner wrapper. Check sticky headers too, because a ring can slip under them; see the scroll padding setting for that.
Mistake 5: custom components that take focus away
Hand-built dropdowns, tabs and modals sometimes use div elements with click handlers, or call blur() to hide a ring. A div cannot be reached by Tab unless it has tabindex="0", and it will not respond to Enter without extra script. Prefer real <button> and <a> elements, which are focusable and operable out of the box. When a modal closes, return focus to the button that opened it.
Putting it together
A small, robust block for most sites:
:focus-visible {
outline: 3px solid var(--focus, #1a56db);
outline-offset: 3px;
border-radius: 2px;
}
.on-dark :focus-visible { --focus: #ffd24a; }
a:focus-visible, button:focus-visible { text-decoration-thickness: 3px; }
Define --focus once in your colour tokens and override it on dark sections.
A five minute audit
- [ ] Click into the page address bar, then press Tab repeatedly and watch the ring travel through the header, menu, body and footer.
- [ ] Confirm the first Tab stop is a skip link and that it is visible when focused.
- [ ] Tab into a form and check inputs, checkboxes, radio buttons and the submit button all show a ring.
- [ ] Open any dropdown, dialog or cookie banner and check focus lands inside it.
- [ ] Switch to Windows High Contrast or a forced-colours emulation in dev tools and look again.
- [ ] Zoom to 200 percent; the ring should still be visible and not clipped.
- [ ] Search your CSS for
outline: none,outline: 0and:focus { outlineto see what remains.
When removing an outline is acceptable
Sometimes you replace the default with your own style, such as a thick underline on links, a background change on a button, or a border on an input. That is allowed as long as the new indicator is clearly visible. Setting outline: none on an input while changing its border colour by one shade is not. If a visitor cannot spot the change at a glance on a poor screen, it is not enough.
FAQ
Do touchscreen users need focus rings?
Not for taps, but switch control, external keyboards and screen readers on tablets do use focus, so the styles should exist.
Does :focus-visible work on text inputs with a mouse?
Yes. Browsers typically show it on text fields even after a click, because the caret and typing context benefit from it.
Should I use outline or box-shadow?
Use outline as the base, since it appears in forced colours mode, and add a box-shadow only as a decoration.
Will a page builder let me fix this?
Many have a custom CSS box. Paste the block there, then test the journey above.
If your site's keyboard experience needs an audit and a tidy fix, please reach us through our enquiry page.