Style width Property
Style width Property
The width property is used to either set or return the width of an element. It is applicable to elements that have fixed or absolute positions or are block-level elements.
Syntax:-
Its syntax is:- object.style.width OR object.style.width = auto | length | % | initial | inherit
Return:-
Its return is:- string having the width of an element
Further Explanation:-
Value | Description |
---|---|
auto | The browser sets width. |
length | Defines width in length units. |
% | Defines width in % of the parent element. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |