CSS height Property
CSS height Property
The height property is used to set the height of an element. It does not include padding, borders, or margins. If the height is set to auto, then, the element will automatically adjust its height to allow its content to be displayed correctly.
Default Value:-
Its default value is auto.
Syntax:-
Its syntax is:- height: auto | length | initial | inherit;
Further Explanation:-
Value | Description |
---|---|
auto | The browser calculates the height. |
length | Defines the height in px, cm, etc. |
% | Defines the height in percent of the containing block |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |