CSS max height Property
CSS max-height Property
The max-height property is used to specify the maximum height of an element. If the content is larger than the maximum height, it will overflow. However, it can be managed by overflow property. If the content is smaller than the maximum height, the max-height property has no effect.
Default Value:-
Its default value is none.
Syntax:-
Its syntax is:- max-height: none | length | initial | inherit;
Further Explanation:-
Value | Description |
---|---|
none | No maximum height. |
length | Defines the maximum height in px, etc. |
% | Defines the maximum height in percent of the containing block |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |