The max-height property is used to set the maximum height of an element. This property prevents the height property's value from becoming larger than the value specified for max-height.
Example of the max-height property:
#myDiv {
background-color:pink;
}