The max-height property in CSS is used to set the maximum height of a specified element. Authors may use any of the length values as long as they are a positive value. max-height overrides height, but min-height always overrides max-height.
height: 100%; /* full height of the content box */
max-height: 20em; /* requires an absolute value for height. */
max-height: 20px; /* Will be AT MOST 20px tall : overrides height */
min-height: 400px; /* overrides height and max-height */
The percentage is calculated with respect to the height of the containing block. If the height of the containing block is not specified explicitly, the percentage value is treated as none. The max-height property will apply to all elements except non-replaced inline elements, table columns, and column groups (i.e. colgroup, col ).