Skip to main content

[CSS] box-sizing

Intro

The box-sizing CSS property sets how the total width and height of an element is calculated.

Values

content-box

This is the initial and default value as specified by the CSS standard.

The width and height properties include the content, but does not include the padding, border, or margin.

border-box

The width and height properties include the content, padding, and border, but do not include the margin.

Reference

  • @MDN - box-sizing