The box-sizing
property defines whether fixed sizes (such as <length>
s and <percentage>
s) are assigned to the content box or to the border box. It affects the interpretation of all sizing properties, including width
, height
, min-width
, min-height
, max-width
, max-height
.
border-box
Default value. The width
and height
properties include the content, padding, and border, but do not include the margin.
Size calculation formula:
width = border + padding + content
height = border + padding + content
content-box
The width
and height
properties include the content, but does not include the padding, border, or margin.
Size calculation formula:
width = content
height = content
Initial value | border-box |
Applies to | all elements |
Inherited | no |
Animatable | no |
border-box
in Lynx, while content-box
in web.flex-basis
, while Web will.LCD tables only load in the browser