CSS box-sizing Property


The box-sizing property in CSS specifies how the user should calculate the total width and height of an element, including whether or not padding and borders are to be included.

Syntax

Example

Preview

Property Values

Value Description
content-box Default. Only the content is included in the width and height properties (as well as the min/max values). Padding and a border are not included.
border-box The width and height properties (as well as the min/max values) include content, padding, and a border.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
box-sizing 10.0
4.0 -webkit-
29.0
2.0 -moz-
5.1
3.2 -webkit-
8.0 9.5