CSS focus: style the element that is receiving keyboard input
Answer: Focus refers to the element on the screen actively receiving input from the keyboard.
Why the ring appears
Skip links, or anchor links, move a keyboard user to the main content of the website.
It's tempting to remove the focus styles in these situations.
Handling focus appropriately and with care helps to create a good, accessible user experience.
Creating accessible focus states with CSS is a part of this responsibility.
Tab sequence
The elements that a keyboard user can navigate to are called focusable elements.
Focus order is also called tab or navigation order.
It is the order in which elements receive focus.
For most languages, that order starts at the top and ends at the bottom.
Default focus order must be logical, intuitive, and match the visual order.
See also
Claims
- id: C1 claim: Creating accessible focus states with CSS is part of making a site inclusive. source: S1 evidence: "Creating accessible focus states with CSS is a part of this responsibility"
- id: C2 claim: It is tempting to remove focus styles in some situations. source: S1 evidence: "It's tempting to remove the focus styles in these situations"
- id: C3 claim: Focus is the element that is actively receiving input from the keyboard. source: S2 evidence: "the element on the screen actively receiving input from the keyboard"
- id: C4 claim: The default focus order must be logical and match the visual order of a page. source: S2 evidence: "The default focus order must be logical, intuitive, and match the visual"
Sources
- [S1] Focus. web.dev. https://web.dev/learn/css/focus . License: CC-BY-4.0. Accessed 2026-11-24.
- [S2] Keyboard focus. web.dev. https://web.dev/articles/focus . License: CC-BY-4.0. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Focus; web.dev, Keyboard focus. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, Focus; web.dev, Keyboard focus. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0.
Cite this
iinventedlight. 2026. "CSS focus: style the element that is receiving keyboard input." iinventedlight Library, iil:note:8krfvd6h, version of 2026-11-24. https://iinventedlight.com/library/notes/css-focus/. License: CC-BY-4.0.
@misc{iil_note_8krfvd6h,
author = {{iinventedlight}},
title = {{CSS focus: style the element that is receiving keyboard input}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/css-focus/},
note = {Permanent ID iil:note:8krfvd6h. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- css-focus.schema.json (schema; CC-BY-4.0)
- css-focus.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-focus.md.