/

HTML / CSS / JavaScript Tutorial

CSS Property: box-sizing

[this page | pdf | back links]

The CSS (CSS3) box-sizing property indicates what the sizing properties of a box (width and height) should be applied to, i.e. just the content-box or some broader definition.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

border-box

Height and width properties (and min-height / min-width / max-height / max-width properties) include content, border and padding (but not margin)

content-box

(default value). Height and width properties (and min-height / min-width / max-height / max-width properties) include only the content, and do not include border, padding or margin

 

Default Value:

content-box

JavaScript syntax:

e.g. object.style.boxSizing="border-box"

Inherited:

No

Animatable:

No

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile