CSS Cascade & Box Model
Style documents predictably by understanding selectors, the cascade, inheritance and the box model, add purposeful motion, and debug styles in DevTools.
5 objectives 6 steps about 135 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Predict which declaration wins using origin, cascade layers, specificity, source order and inheritance, and resolve conflicts without !important.
- Size and space elements with the box model (content, padding, border, margin, box-sizing), normal flow and block vs inline display.
- Apply typography, color and relative units (rem, em, %, viewport units, ch) and place elements with relative, absolute, fixed and sticky positioning.
- Diagnose a styling bug with the DevTools Styles and Computed panels and state its cause.
- Animate state changes with transitions, transforms, keyframes and view transitions, animating only compositor-friendly properties and honouring prefers-reduced-motion.
Lesson plan
6 steps, about 135 min · 5 of 5 lessons available so far
- Selectors and How Rules Find Elements Concept · 20 min
- Untangling the Cascade, Specificity and Layers Worked example · 25 min
- Boxes, Flow, Display and Positioning Concept · 25 min
- Units, Type, Color and Motion Concept · 25 min
- Lab: Debug a Broken Stylesheet in DevTools Lab · 25 min
- Check: Predict the Computed Style Knowledge check · 10 questions
Practise it
Style your semantic article page from one external stylesheet organised into @layer reset, base and components, then fix five seeded bugs (specificity clash, collapsed margins, overflow, stacking order, wrong unit) and write one sentence per bug explaining its cause; finish with a menu transition that animates only transform and opacity and is switched off under prefers-reduced-motion.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Web BrowserAdvanced · 30–60 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.