box-sizing

Initial value content-box
Applies to all elements that accept width or height

Syntax

  
box-sizing: border-box;
  

Values

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. For example, .box {width: 350px; border: 10px solid black;} renders a box that is 370px wide.
Here, the dimensions of the element are calculated as: width = width of the content, and height = height of the content. (Borders and padding are not included in the calculation.)

Browser support

box-sizingchrome10edge12firefox29ie8opera7safari5.1
padding-boxchromeedgefirefox1ieoperasafari

We use cookies to improve your experience. Learn more in our Privacy policy.

×