box-sizing Playground

Dodi’s crates on Mr. Karim’s shelf: set box-sizing, width, padding and border, the browser lays the crates out, and the margin-box sums show which crates fit…

Why it matters

The number one cause of "my 50% column drops down" and "my box is too wide". Knowing content-box from border-box (and why almost every project, Tailwind included, resets everything to border-box) means the size you write is the size you get.

The key idea

content-box adds padding and border outside width, border-box counts them inside

Common mistakes

Try it in this playground