A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
<style>:focus-visible{outline:3px solid #2563eb;outline-offset:2px;}</style><main class="demo">Example content</main>
A good CSS change narrows the problem. CSS supports visibility and geometry; actual focus order belongs to DOM order and interaction logic. This keeps the rule understandable when content, theme, or viewport conditions change later.
| Concern | What to inspect | Typical failure |
|---|---|---|
| Core behavior | Focus Management and Keyboard Accessibility | Never use outline:none without supplying an equally strong focus indicator. |
| Production test | Real content and constraints | The rule works only for the demo values |
| Maintenance | Scope and override path | A later fix creates another exception |
In production, Never use outline:none without supplying an equally strong focus indicator. That is the kind of bug that survives visual spot checks because the stylesheet is syntactically valid while the layout contract is wrong.
The useful mental model here is practical: how CSS should expose focus without trapping or hiding keyboard position. When a rule looks obvious but the browser produces something else, start by identifying which constraint or rendering phase is actually winning.
<style>.skip-link{position:absolute;inset-block-start:0;}</style><main class="skip-link">Example content</main>
Engineering judgment: CSS supports visibility and geometry; actual focus order belongs to DOM order and interaction logic.
<style>.panel:focus-within{box-shadow:0 0 0 3px #93c5fd;}</style><main class="panel">Example content</main>
Example 3 is useful here because it demonstrates focus management and keyboard accessibility under a concrete input rather than as an abstract property list.
<style>button{scroll-margin-block:6rem;}</style><main class="demo"><button type="button">Example action</button></main>
Example 4 is useful here because it demonstrates focus management and keyboard accessibility under a concrete input rather than as an abstract property list.
Finish the lesson once you have worked through the material. This awards ★ 40 XP.