← Back to properties

CSS Property

box-sizing

Sizing

Controls whether padding and border are included in an element's total width and height.

Syntax

box-sizing: value;

Example

box-sizing: border-box;

Common use cases

  • Preventing layout overflow from padding
  • Making width calculations predictable
  • Universal box model reset

Practical developer insight

border-box is the most predictable box model and is commonly used as a global default — add * { box-sizing: border-box } to every project.

Related properties