CSS box-sizing decides if specified width, height, etc. will apply to content area of an element or to whole element including padding and border.
CSS property box-sizing
CSS version:
CSS 3
Value:
content-box | border-box
Initial:
conent-box
Applies to:
all elements that accept width or height
Inherited:
no
box-sizing values
value
Description
content-box
specified width and height apply to of the content box of the element. Two element with same width and height but different padding or border will have different overall size.
border-box
specified width and height apply to of the whole element including padding and border. Two element with same width and height but different padding or border will have same overall size
Example – box-sizing content-box and border-box
In the following code, CSS property box-sizing can be changed to the following values