HTML Dog
Skip to navigation

CSS Property: max-height

The maximum height of the content area of a box.

As with height, the maximum height is based on the content area only — any vertical padding, border, or margin will be in addition.

Possible Values

ValueNoteExample
[length]Should not be a negative value.600px
[percentage]Calculated in relation to the width of the containing box. Should not be a negative value.40%
noneNo maximum height constraint.
inherit
initial
unset

Example


section {
        max-height: 400px;
        overflow: scroll;
}

Browser support