max-height

The max-height property constrains the height of an element to a maximum range.

CSS2

Syntax

max-height: <length> | <percentage> | none | inherit
Initial: none
Applies To: all elements but non-replaced inline elements, table columns, and column groups
Inherited: no
Percentages: refer to height of containing block
Media: visual

Values

max-height: value
Value Description
length Fixed maximum height
none No height limit
percentage Height percentage calculated with respect to the height of the containing block

DOM

[window.]document.getElementById("element-id").style.maxHeight = "max-height";

Example | length

Example | none

Example | percentage

Example | DOM

External

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification