Level
AA
Since
WCAG 2.0
Entries
99 / 193
/ WCAG criterion

2.4.7 Focus Visible

A person moving through the page with a keyboard must always be able to see which element has focus.

/ What it requires

Sighted keyboard users, including people with motor disabilities and anyone using a switch or voice control, steer by the focus indicator: the ring, underline or colour change that marks the current control. Without it they are pressing Tab blind. They cannot tell which link Enter will follow or which field their typing will go into, and the only way forward is to guess, or to watch the status bar for a URL.

The page passes when every element that can be operated by keyboard shows a visible indicator while it has focus. The default outline of the browser counts. At this level WCAG sets no minimum size or contrast for the indicator: criterion 1.4.11 asks for 3:1 contrast against adjacent colours for indicators the author has styled, and the AAA criterion 2.4.13 adds size requirements. A focus style applied with :focus-visible, which browsers show for keyboard use, passes.

/ How pages fail it

  • A reset stylesheet sets outline: none or outline: 0 on :focus and nothing replaces it.
  • The outline is removed on links and buttons only, so form fields show focus and everything else does not.
  • The focus style exists but a parent with overflow: hidden clips it, so nothing is painted.
  • A custom checkbox or radio button hides the native input, and the styled replacement has no focus state.
  • The indicator has the same colour as the background it sits on, for example a white ring on a white page.

/ How to check it yourself

  1. Click in the address bar, then press Tab through the whole page. At every stop you should be able to point to the focused element without hesitation.
  2. Pay attention to the logo link, icon buttons, custom checkboxes, carousel arrows and the cookie banner, where indicators most often go missing.
  3. When focus seems to disappear, type document.activeElement in the DevTools console to find the element that has it.
  4. Search the CSS for outline: none and outline: 0 and check that each one has a replacement style on the same selector.
  5. Repeat with a Windows contrast theme switched on. Forced colours mode does not draw box-shadow, so an indicator made only of shadow vanishes.

/ How to fix it

  • Delete outline: none from :focus rules, or pair it with a visible replacement on the same selector.
  • Add a clear style such as :focus-visible { outline: 2px solid; outline-offset: 2px; } in a colour that stands out from the background.
  • If the ring is drawn with box-shadow, keep outline: 2px solid transparent next to it so that forced colours mode still draws an outline.
  • For custom checkboxes and radio buttons, style the visible replacement while the hidden input has focus, with a selector such as input:focus-visible + label.
  • Look for a parent with overflow: hidden that cuts the outline off, and use a negative outline-offset or some padding to keep the indicator inside.

/ What our scanner checks

The check focus-not-visible runs in a real browser. It gives focus to up to 150 tab stops and compares what each element paints before and after: outline, border, shadow, background, text colour and decoration, and its ::before and ::after. If nothing changed, it reports the element. It cannot see an indicator drawn on a parent or sibling, and does not judge whether a change is strong enough to notice.

/ Who fails it, in our own measurements

Measured bodies failing this criterion, most instances first
BodySectorInstancesScore
Uniwersytet Śląskieducation · PL1478
Rybnikcity · PL1447
Uniwersytet Jagiellońskieducation · PL1391
Chicago Transit Authoritytransport · US1224
Narodowy Fundusz Zdrowiahealth · PL10318
Narodowy Instytut Dziedzictwaculture · PL936
Nashvillecity · US9214
Politechnika Warszawskaeducation · PL8212
Szczecincity · PL793
Bundeszentrale für politische Bildunggovernment · DE7410
Uniwersytet Warszawskieducation · PL673
Bremencity · DE615
LA Metrotransport · US5917
Policjagovernment · PL5512
Politechnika Poznańskaeducation · PL544
Uniwersytet Wrocławskieducation · PL4713
Gdyniacity · PL337
Internal Revenue Servicegovernment · US3020
Politechnika Łódzkaeducation · PL305
Zielona Góracity · PL287
Komisja Nadzoru Finansowegogovernment · PL248
Freie Universität Berlineducation · DE237
Tychycity · PL2320
Miami-Dade Countygovernment · US2220
Bundesministerium für Gesundheitgovernment · DE2046
Muzeum Narodowe w Warszawieculture · PL1911
Berliner Verkehrsbetriebetransport · DE1721
Lublincity · PL1717
Phoenixcity · US171
Politechnika Śląskaeducation · PL172
Bundestaggovernment · DE1610
Sosnowieccity · PL1628
Wrocławcity · PL162
Poznańcity · PL151
Deutsche Nationalbibliothekculture · DE1423
Hannovercity · DE1410
Radomcity · PL132
Los Angeles Countygovernment · US1210
Ludwig-Maximilians-Universität Müncheneducation · DE1212
University of Floridaeducation · US1223
Państwowa Komisja Wyborczagovernment · PL1115
Uniwersytet Mikołaja Kopernikaeducation · PL117
Gdańskcity · PL102
Leipzigcity · DE1022
NASAgovernment · US1020
Statistisches Bundesamtgovernment · DE109
Urząd Komunikacji Elektronicznejgovernment · PL1025
Amtraktransport · US91
Politechnika Gdańskaeducation · PL922
Denvercity · US839
Deutsche Bahntransport · DE86
Dresdencity · DE815
Pacjent.gov.plhealth · PL89
Główny Urząd Statystycznygovernment · PL716
Uniwersytet Łódzkieducation · PL79
Baltimorecity · US67
Biblioteka Narodowaculture · PL617
Bundesministerium der Finanzengovernment · DE613
Cook Countygovernment · US611
Toruńcity · PL611
Las Vegascity · US58
State of Floridagovernment · US58
Teatr Wielki Opera Narodowaculture · PL53
University of California, Berkeleyeducation · US571
Bundesregierunggovernment · DE44
Deutsche Rentenversicherunggovernment · DE45
Harris Countygovernment · US419
Koleje Mazowieckietransport · PL417
Opolecity · PL48
State of Washingtongovernment · US48
Stuttgartcity · DE46
Hamburgcity · DE322
Austincity · US213
Bundesverfassungsgerichtgovernment · DE218
Bydgoszczcity · PL27
Department of Laborgovernment · US246
Krajowa Administracja Skarbowagovernment · PL25
Ohio State Universityeducation · US26
Uniwersytet Ekonomiczny w Krakowieeducation · PL215
Bostoncity · US16
Bundesministerium für Bildung und Forschunggovernment · DE18
Dallascity · US123
Department of Justicegovernment · US127
Gorzów Wielkopolskicity · PL16
Houstoncity · US17
Karlsruher Institut für Technologieeducation · DE119
Katowicecity · PL112
King Countygovernment · US113
Münchencity · DE122
Narodowy Bank Polskigovernment · PL123
New Orleanscity · US17
Philadelphiacity · US18
Polski Instytut Sztuki Filmowejculture · PL17
San Diegocity · US152
Sejm RPgovernment · PL19
State of Pennsylvaniagovernment · US121
Sąd Najwyższygovernment · PL114
Technische Universität Müncheneducation · DE112
Veterans Affairsgovernment · US133

One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.

/ Questions about this criterion

Is outline: none a WCAG failure?

On its own it removes the default focus indicator of the browser, and if nothing replaces it the page fails 2.4.7. W3C documents this as failure F78. It is fine when the same rule supplies another visible indicator, such as a border, a background change or a box-shadow, though a shadow alone disappears in forced colours mode.

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

The :focus selector matches whenever an element has focus, including after a mouse click. The :focus-visible selector matches when the browser decides an indicator is needed, which in practice means keyboard navigation and text fields. Styling :focus-visible keeps rings off buttons clicked with a mouse and still satisfies 2.4.7, because keyboard users get the indicator.

Does the focus indicator need a minimum contrast or thickness?

Not under 2.4.7, which only requires that it is visible. Contrast comes from 1.4.11 Non-text Contrast, which asks for at least 3:1 against adjacent colours when the author has styled the indicator. Size, and a 3:1 change between the focused and unfocused states, are set by 2.4.13 Focus Appearance, a level AAA criterion added in WCAG 2.2.