Module 03 of 11

Box Model & Display

Lessons

About This Module

Every element on a web page is a rectangular box, and almost every layout problem comes back to how big that box is and how much space surrounds it. The box model describes the four layers of every box — content, padding, border, and margin — and once you can picture them, spacing and sizing stop feeling like guesswork.

This module starts with the box model itself, then looks at box-sizing, the one-line setting that changes how width and height are calculated and that most modern stylesheets switch to border-box. It then covers margin collapsing, the surprising behavior where adjacent vertical margins merge, and finishes with the display property: how block, inline, and inline-block elements flow, and which of the box properties apply to each.

Watch the lessons in order, then continue on to Typography & Colors.

Lessons

4 videos
01

CSS Box Model Explained (Padding, Border, Margin)

A beginner-friendly look at the content, padding, border, and margin layers that make up every element — the building block of every website.

02

CSS Box Sizing & Border Box

A detailed, visual explanation of the box-sizing property and the difference between the content-box and border-box values.

03

CSS Margin Collapse Explained

Why margins between adjacent block-level elements can merge into the larger of the two, and how to recognize and control that behavior.

04

CSS Display Property Explained (Block, Inline, Inline-Block, None)

How the display property works for block, inline, and inline-block elements, and how padding, border, and margin behave in each type.