Understanding the CSS Box Model, Cascade & Specificity
A simple guide to understanding how CSS decides size, spacing, and which style wins when multiple rules target the same element.
The CSS Box Model
In CSS, every HTML element can be understood as a rectangular box. The box model has four parts: content, padding, border, and margin.
Margin






