Every element in CSS is a rectangular box made of four layers, from inside out: content, padding, border, and margin. Understanding how they combine is the foundation of all layout.
text
┌─────────────── margin ───────────────┐ ← space OUTSIDE, between elements
│ ┌──────────── border ────────────┐ │
│ │ ┌───────── padding ────────┐ │ │ ← space INSIDE, around content
│ │ │ content │ │ │ ← text/image (width × height)
│ │ └──────────────────────────┘ │ │
│ └─────────────────────────────────┘ │
└────────────────────────────────────────┘
