Specifies how the width and the height of the element are calculated. It affects the height and width properties.
Note: The box-sizing property is supported in Internet Explorer from version 8.
Use the -moz-box-sizing property in Firefox and the -webkit-box-sizing property in Google Chrome and Safari instead.
One of the following values:
|The height and width properties include the padding and the border but not the margin.|
|The height and width properties include only the content but not the margin, border and the padding.|
|Takes the value of this property from the computed style of the parent element.|
|The height and width properties include everything (margin, border, padding, content).|
|The height and width properties include the padding but not the margin and the border.|
Example HTML code 1:
This example illustrates the use of the box-sizing, -moz-box-sizing and the -webkit-box-sizing properties:
Did you find this example helpful?
Supported by tags:
User Contributed Comments