example.com
Broken markup
Tab through this row in both states. Same tab order, same elements — only one of them tells you anything.
✕ What breaks it
a,
button {
(flagged, see note 2) outline: none;
}
- Nothing replaces it, so keyboard focus becomes invisible across the entire page.
- This is usually copied in to hide the ring on mouse click — :focus-visible already does that for you.
✓ What fixes it
(flagged, see note 1) a:focus-visible,
button:focus-visible {
outline: 3px solid #ffffff;
outline-offset: 2px;
(flagged, see note 2) box-shadow: 0 0 0 6px #0e1420;
}
- :focus-visible fires for keyboard focus and stays quiet for mouse clicks — the behaviour people actually wanted.
- A second ring in the opposite tone keeps the indicator visible on light and dark backgrounds alike.