FireEdgeX
0

LESSON 02 ยท CSS

The box model

Content, padding, border, and margin determine an element's box.

6 min readIn progress

THE IDEA

Understand the concept

Every element is laid out as a box: content sits inside padding, then border, then margin. Setting box-sizing to border-box includes padding and border in the declared width, making sizing easier to reason about.

WORKED EXAMPLE

See it in context

Example