Style boxSizing Property
Style boxSizing Property
The boxSizing property is used to define how certain elements fit in an area in a certain way like we want two boxes to place side by side. For this purpose, we have to set its box-sizing property to border-box. It forces the browser to render a box with given width and height and places border and padding inside the box.
Syntax:-
Its syntax is:- object.style.boxSizing OR object.style.boxSizing = content-box|border-box|initial|inherit
Return:-
Its return is:- string having box-sizing property of an element
Further Explanation:-
Value | Description |
---|---|
content-box | In this, only the given/specified width and height of the box are included while it excluded the border and padding of the box. |
border-box | In this, the box contains the width, height, padding, and border. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |