The box model
Every HTML element is a box with four layers: content, padding, border, and margin. These layers control the element's size and spacing.
What it does: The content area is the core of the box model, holding the element's actual content. border-box is widely used because the element's total size matches the declared width. The order outward is: content → padding → border → margin. Margin is the outermost layer — it separates the element from its neighbours. Margin is outside the border — it pushes other elements away. CSS declarations always need a colon between the property name and its value. Property names must be spelled exactly. 'margn' is not a valid CSS property.
Common mistakes: div.hover targets a div with class='hover', not all divs. To style all div elements, use div {} without a class selector. A colon is missing after the property name. It should be padding: 15px; not padding 15px;.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
box modelFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →