Accessibility

Focus indicator

A focus indicator is the visible change, usually an outline or ring, that shows which control currently has keyboard focus.

WCAG 2.4.7 Focus Visible requires one at Level AA, and when you style your own it needs 3:1 contrast against the colors beside it. Removing it with outline: none leaves sighted keyboard users unable to see where they are on the page.

At a glance

DefinitionThe pixels that change to show a control is in its focused state, in WCAG's own words (2.4.7)
Required2.4.7 Focus Visible, Level AA: a visible indicator in at least one mode of operation, and it may not be time-limited
Contrast3:1 against adjacent colors when the author styles it (1.4.11, Level AA); the browser default is exempt from the ratio but must still be visible
Not hiddenA sticky header, footer or overlay may not fully cover the focused control (2.4.11, Level AA, new in WCAG 2.2)
Size, at AAAAt least a 2 CSS pixel perimeter around the component, changing by 3:1 between focused and unfocused (2.4.13, Level AAA)
In CSSStyle it on :focus-visible, so keyboard focus shows it and pointer clicks do not (MDN)
Found byOverlayQA Accessibility Audit reports "No visible focus indicator" (2.4.7) when a control suppresses the default outline with no :focus rule; Auto Review flags interactive elements with no :focus rule in the stylesheet

Why it matters

Every control is designed at rest and used in motion. A keyboard user moves through a page with Tab and can act only on a control they can see is focused, which is why WCAG makes the indicator a Level AA requirement (2.4.7) and, in version 2.2, adds that the focused control may not be entirely hidden behind author content such as a sticky header (2.4.11). Browsers once drew a ring on every click, authors removed it as ugly, and the fix has been available everywhere since March 2022: :focus-visible shows the indicator for keyboard focus and hides it for pointer clicks. MDN's summary is blunt: removing focus styles makes keyboard navigation inaccessible for sighted users.

How do you build a focus indicator that passes?

Examples

IndicatorVerdict
Browser default ring, untouchedPasses 2.4.7; exempt from the 1.4.11 ratio
outline: none and nothing elseFails 2.4.7 (F78)
2px solid #3468F8 ring on whitePasses: 4.69:1 against white
Light gray ring on whiteFails 1.4.11 below 3:1; the W3C example is 2.3:1
Ring that fades out after a momentFails 2.4.7: it must stay visible while focused
Focused button under a sticky footerFails 2.4.11 when the control is entirely hidden (F110)

Common mistakes

Frequently asked questions

Is a focus indicator required by WCAG?

Yes. Success criterion 2.4.7 Focus Visible, Level AA, requires that any keyboard-operable interface has a mode of operation where the keyboard focus indicator is visible. WCAG 2.2 adds 2.4.11, also Level AA, so the focused control may not be entirely hidden by content such as a sticky header, and 2.4.13 at Level AAA, which sets a minimum size and contrast for the indicator itself.

What is the difference between :focus and :focus-visible?

:focus matches whenever an element has focus, including after a mouse click. :focus-visible matches only when the browser decides the focus should be shown, which in practice means keyboard navigation. Styling the indicator on :focus-visible lets you change how it looks without changing when it appears, and it has been supported across browsers since March 2022.

How much contrast does a focus indicator need?

When you style it yourself, at least 3:1 against the adjacent colors under 1.4.11 Non-text Contrast, Level AA. The browser default indicator is exempt from the ratio as long as you have not modified it, but it must still be visible. At Level AAA, 2.4.13 Focus Appearance also asks for a 3:1 change between the focused and unfocused states over an area at least as large as a 2 CSS pixel perimeter.

Can I remove the focus outline for mouse users?

You can hide it for pointer clicks without removing it for keyboard users by styling :focus-visible instead of :focus; browsers then show the indicator only when their heuristics say it helps, which covers Tab navigation. Removing it outright with outline: none, with no visible alternative, fails 2.4.7 and is listed by the W3C as failure technique F78.

Sources: WCAG 2.2, 2.4.7 Focus Visible, WCAG 2.2, 2.4.11 Focus Not Obscured (Minimum), WCAG 2.2, 2.4.13 Focus Appearance, WCAG 2.2, 1.4.11 Non-text Contrast, MDN, :focus-visible.

Last updated October 22, 2026