Visit Mozilla.org

CSS:max-height

From MDC

« CSS Reference

[edit] Summary

The max-height property is used to set the maximum height of a given element. It prevents the used value of the height property from becoming larger than the value specified for max-height.

[edit] Syntax

max-height: <length> | <percentage> 

[edit] Values

  • none : the height has no maximum value
  • length : can be in px, cm, in
  • percentage : % specified as a percentage of containing block's height

[edit] Examples

View Live Examples (FIXME)

table { max-height: 75%; }

form { max-height: none; }

[edit] Notes

max-height overrides height, but min-height overrides max-height.

[edit] Specifications

[edit] Browser compatibility

Browser Lowest Version
Internet Explorer 6
Netscape 6
Opera 3.5

[edit] See also

box model, max-width, -moz-box-sizing, height, min-height