Example

A simple box-sizing property example:

Laboratory

description & Usage

We use the box-sizing property to calculate the width and height of an element.

Informations

# Description
Default Value content-box
Inherited no
Animatable no
Version CSS3
JavaScript syntax object.style.boxSizing="border-box"

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
box-sizing

Syntax

Values

Values Description
content-box By default, it determines the width and height (minimum and maximum) properties of a content.
border-box Specifies the width and height (minimum and maximum) properties.
initial Adds this value to its default property.
inherit It inherits this value from its parent tag.