CSS height property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS height property defines physical height of an element (box). The length units might be px, em, pt, in.
The min-height and max-height of child element is 150px and 200px respectively.
Syntax
height : auto | length | percentage | min-content | max-content
Property values
autoDefault
-
auto value means the height will be changed automatically according to the content.
- Try it
height: auto; min-content
-
min-content value represents that the height of an element must be equal to or greater than the largest minimum height of some descendant item i.e. it depends upon the minimum height of child element.
In this case, the min-height of descendant element is 100px.
- Try it
height: min-content; max-content
-
max-content value means the height of an element must be equal to or less than the largest maximum height of some descendant item i.e. it depends upon the miximum height of child element.
In this case, the max-height of descendant element is 200px.
- Try it
height: max-content;
Applicable to
It applies to all elements except non-replaced inline.