Border box

noun

say it: “BOR-der BOKS” /ˈbɔrdər bɑks/

A box-sizing value where width and height include the padding and border, so a box set to 300px wide stays 300px wide however much padding you add.

What does box-sizing: border-box mean?

With border-box, the width you set includes padding and border, so a 300px card really is 300px wide.

.card { box-sizing: border-box; width: 300px; padding: 20px; }   /* still 300px wide */

In a sentence

  • “After I switched to border-box, my three 33% columns with padding finally fit side by side.”

Level: Apprentice · More CSS terms at this level

Updated