Accessibility: Visible focus
A keyboard target needs an obvious focus indicator. Do not remove outlines without an equally visible replacement.
Current edit
Understand the pattern
A keyboard target needs an obvious focus indicator. Do not remove outlines without an equally visible replacement.
A keyboard target needs an obvious focus indicator. Do not remove outlines without an equally visible replacement.
Misconceptions to reject
- A visual appearance alone guarantees the intended HTML meaning.
- Replacing semantic elements with generic divs automatically improves accessibility.
The preview is a sanitized subset, not a full browser compatibility test.
Worked example and expected result
<a href="#content" class="skip-link">Skip to content</a><main id="content" tabindex="-1"><h1>Keyboard practice</h1><button type="button">Continue</button></main>A keyboard target needs an obvious focus indicator. Do not remove outlines without an equally visible replacement.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: Accessibility: Status announcementsTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.
Keep learning
- 01Accessibility: Keyboard orderNative links and buttons participate in keyboard navigation in source order. Positive tabindex usually creates surprising jumps.Practice
- 02Accessibility: Status announcementsrole="status" communicates non-urgent updates without requiring an interrupting alert or focus change.Practice
- 03Accessibility: Heading structureHeadings organize navigable topics. Styling a paragraph to look large does not give it heading semantics.Practice