A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
<style>.card { padding: 1rem; }</style><main class="card">Example content</main>
Engineering judgment: Start with the most constrained content model and add capability as space increases. This usually reduces overrides and specificity collisions.
| Concern | What to inspect | Typical failure |
|---|---|---|
| Core behavior | Mobile-First CSS | Mobile-first does not mean mobile-only. The base styles should be a complete usable experience, not a pile of temporary defaults that desktop rules are expected to repair. |
| 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 to build the baseline for constrained screens first and layer enhancements upward. When a rule looks obvious but the browser produces something else, start by identifying which constraint or rendering phase is actually winning.
A good CSS change narrows the problem. Start with the most constrained content model and add capability as space increases. This usually reduces overrides and specificity collisions. This keeps the rule understandable when content, theme, or viewport conditions change later.
<style>@media (min-width: 48rem) { .card { padding: 1.5rem; } }</style><main class="card">Example content</main>
In production, Mobile-first does not mean mobile-only. The base styles should be a complete usable experience, not a pile of temporary defaults that desktop rules are expected to repair. That is the kind of bug that survives visual spot checks because the stylesheet is syntactically valid while the layout contract is wrong.
<style>@media (min-width: 64rem) { .layout { grid-template-columns: 18rem 1fr; } }</style><main class="layout">Example content</main>
Desktop columns is useful here because it demonstrates mobile-first css under a concrete input rather than as an abstract property list.
<style>.nav__secondary { display:none; }</style><main class="nav__secondary">Example content</main>
Opt out sparingly is useful here because it demonstrates mobile-first css 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.