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
| Value | Note | Example |
|---|---|---|
| [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% |
none | No maximum height constraint. | |
inherit | ||
initial | ||
unset | ||
Example
section {
max-height: 400px;
overflow: scroll;
}
