A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
<style>.nav { display:flex; flex-wrap:wrap; gap:.75rem; }</style><main class="demo"><nav><a href="#">Home</a><a href="#">Docs</a></nav></main>
Engineering judgment: Use CSS to adapt layout and density; use JavaScript or native disclosure controls to manage actual navigation state.
<style>@media (max-width: 48rem) { .nav__links { display:none; } }</style><main class="nav__links">Example content</main>
A good CSS change narrows the problem. Use CSS to adapt layout and density; use JavaScript or native disclosure controls to manage actual navigation state. This keeps the rule understandable when content, theme, or viewport conditions change later.
In production, Hiding navigation links with CSS does not create an accessible mobile menu by itself. Interaction state and semantics still belong to HTML and behavior code. That is the kind of bug that survives visual spot checks because the stylesheet is syntactically valid while the layout contract is wrong.
| Concern | What to inspect | Typical failure |
|---|---|---|
| Core behavior | Building Adaptive Navigation and Layouts | Hiding navigation links with CSS does not create an accessible mobile menu by itself. Interaction state and semantics still belong to HTML and behavior code. |
| 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 |
The useful mental model here is practical: how navigation can switch structure or arrangement without becoming brittle. When a rule looks obvious but the browser produces something else, start by identifying which constraint or rendering phase is actually winning.
<style>.nav { display:grid; grid-template-columns:auto 1fr auto; }</style><main class="demo"><nav><a href="#">Home</a><a href="#">Docs</a></nav></main>
Grid shell is useful here because it demonstrates building adaptive navigation and layouts under a concrete input rather than as an abstract property list.
<style>.tabs { overflow-x:auto; }</style><main class="tabs">Example content</main>
Overflow fallback is useful here because it demonstrates building adaptive navigation and layouts under a concrete input rather than as an abstract property list.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.