6 min read·Updated April 14, 2026

Keyboard Focus Indicator Not Visible

Serious violation Medium lawsuit risk
WCAG 2.4.7 Focus Visible (Level AA)WCAG 2.4.11 Focus Appearance (Level AA — WCAG 2.2)WCAG 2.4.12 Focus Not Obscured (Level AA — WCAG 2.2)
Detected by

axe DevTools (rule: scrollable-region-focusable), Lighthouse (partial detection), WAVE (alerts for missing focus indicators), manual keyboard testing is essential

Why it matters

The keyboard focus indicator is to keyboard users what a mouse cursor is to mouse users — it shows exactly where you are on the page. Without a visible focus indicator, keyboard-dependent users must guess which element is currently active, making navigation impossibly slow and error-prone. This affects people with motor disabilities who use keyboards, tab-navigation users, power users navigating complex forms, and anyone who temporarily cannot use a mouse. WCAG 2.4.7 (Focus Visible) is a Level AA criterion making it legally required. WCAG 2.2 added the more specific 2.4.11 (Focus Appearance) with minimum size and contrast requirements for the focus indicator. The practice of removing outlines globally with "outline: none" in CSS is one of the most common and damaging accessibility anti-patterns in web development.

Symptoms — what you'll see

If your site has this problem, you may observe any of the following:

  • Tabbing through the page shows no visual indicator of which element has focus
  • CSS removes the browser default focus ring (outline: none or outline: 0)
  • Custom focus styles exist in design but were not implemented in code
  • Focus ring appears on some elements but disappears on others
  • Keyboard users cannot tell where they are on the page during navigation
  • axe DevTools flags elements with insufficient focus indicators
  • WCAG 2.4.7 violation reported in accessibility audit

Common causes

  • CSS resets or normalize.css overrides that include "*:focus { outline: none }"
  • Designers requesting the removal of focus rings because they look "ugly" to sighted mouse users
  • CSS frameworks (Bootstrap pre-5, older Tailwind configs) that suppress focus outlines by default
  • Developers using :focus instead of :focus-visible, causing rings to appear on click (ugly) then removing them globally
  • Copy-pasted CSS snippets from StackOverflow that remove outlines as a "fix" for visual issues
  • Focus styles not tested during development because most developers use a mouse
  • Third-party widgets injecting their own CSS that overrides focus styles

How to fix it

  1. 1Search your CSS codebase for "outline: none", "outline: 0", and ":focus { outline" and audit every instance.
  2. 2Remove any :focus { outline: none } rules that suppress focus indicators without providing alternatives.
  3. 3Use :focus-visible pseudo-class instead of :focus to show focus rings only for keyboard navigation (not mouse clicks), improving aesthetics without harming accessibility.
  4. 4Design focus styles that meet WCAG 2.4.11: the focus indicator must have at least 3:1 contrast against adjacent colors and enclose the component.
  5. 5A good baseline: outline: 3px solid #005fcc; outline-offset: 2px applied to :focus-visible.
  6. 6For custom components, ensure focus styles are applied to the actual focusable element, not a parent wrapper.
  7. 7Test your focus styles in both light and dark modes, on all background colors used across your site.

Code example

Before — failing
/* BROKEN: removes all focus indicators globally */
*:focus { outline: none; }

/* BROKEN: only shows focus on mouse click, not keyboard */
button:focus { outline: none; }
button:active { box-shadow: 0 0 0 2px #007aff; }
After — passing
/* FIXED: remove outline only for mouse users, keep for keyboard */
*:focus:not(:focus-visible) { outline: none; }

/* FIXED: visible focus ring for keyboard users */
*:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
  border-radius: 2px;
}

/* FIXED: high-contrast alternative for dark backgrounds */
.dark-bg *:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

Get a free audit — we'll find every issue like this on your site

Our specialists run a full WCAG 2.1 AA review in 48 hours. No credit card required.

How to test your fix

After applying the fix, verify it works using these testing steps:

  1. Tab through your entire site without a mouse and verify a visible focus indicator is present on every interactive element.
  2. Check that the focus indicator has at least 3:1 contrast against the adjacent background color.
  3. Open DevTools and search for "outline: none" and "outline: 0" in your compiled CSS.
  4. Test in high contrast mode: Windows High Contrast Mode and macOS Increase Contrast — focus styles must remain visible.
  5. Use the axe DevTools extension and check for focus-related violations.
  6. Test in multiple browsers: Chrome, Firefox, and Safari render default focus rings differently.

Frequently asked questions

Can I use :focus-visible to hide focus rings for mouse users only?+

Yes — this is the recommended approach. :focus-visible applies only when the browser determines the user is navigating by keyboard or other non-pointer means. Use :focus:not(:focus-visible) { outline: none } to suppress rings on mouse clicks while keeping them for keyboard navigation. Check caniuse.com for browser support — it is broadly supported as of 2024.

What does WCAG 2.4.11 require for focus appearance?+

WCAG 2.4.11 (Level AA, added in WCAG 2.2) requires the focus indicator to: (1) have an area at least as large as a 2px perimeter around the component; (2) achieve a contrast ratio of at least 3:1 between focused and unfocused states; and (3) not be entirely hidden by other content. This is more specific than the older 2.4.7.

Our designer says focus rings are ugly — what should I do?+

Focus rings do not have to match the browser default. You can design custom focus indicators that match your brand — a colored outline, a box shadow, a filled background, or a combination — as long as they meet the contrast and size requirements. Many design systems (Radix UI, Adobe Spectrum) use attractive custom focus indicators that pass WCAG.

Are focus indicators required inside modals?+

Yes. Focus indicators must be visible on all interactive elements everywhere on the page, including modal dialogs, dropdown menus, and overlays. Focus should also be managed appropriately — moved into the modal on open and cycled within it until closed.

Does the focus indicator need to work in Windows High Contrast Mode?+

Best practice is yes. Windows High Contrast Mode overrides CSS colors, so outline-based focus indicators generally survive. Box-shadow-only focus indicators may disappear. To ensure compatibility, use outline for the focus indicator rather than box-shadow alone, or use the Windows high contrast CSS media query to provide specific high-contrast focus styles.

Stop guessing — get a full WCAG audit

Free 5-page WCAG 2.1 AA audit. Real specialists, 48-hour turnaround, no credit card. We find every issue — not just this one.