Style maxHeight Property
Style maxHeight Property
The maxHeight property is used to either set or return the maximum height of an element. It only works on those elements which are either in fixed or absolute position or are block-level elements. However, the height of an element is never greater than the max height. For either setting or getting the minimum height of an element, we use the minHeight property.
Syntax:-
Its syntax is:- object.style.maxHeight OR object.style.maxHeight = none | length | % | initial | inherit
Return:-
Its return is:- string having a maximum height of an element
Further Explanation:-
Value | Description |
---|---|
none | No limit on height of the element. |
length | Defines maximum height in length units. |
% | Defines maximum height in % of parent element. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |