Name

max-height

Values:

<length> | <percentage> | none | inherit

Initial value:

none

Applies to:

All elements except inline nonreplaced elements and table elements.

Inherited:

No.

Percentages:

Refer to the height of the containing block.

Computed value:

For percentages, as specified; for length values, the absolute length; otherwise, none.

Description:

The value of this property sets a maximum constraint on the height of the element. Thus, the element can be shorter than the specified value but not taller. Negative values are not permitted.

Example:

div#footer {max-height: 3em;}

Supported by:

Firefox, Internet Explorer 7+, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.