163 of 313 menu

The max-height property

The max-height property sets a maximum height of an element. The property value is any size units or the none keyword, meaning no value.

Typically set for an element with a floating width (the height is set as a percentage or not set at all, and the element’s height is expanded by its content). If a maximum height is specified, then the element cannot become greater than this height.

Syntax

selector { max-height: value; }

See also

  • the min-height property
    that sets a minimum height of an element
  • the max-width property
    that sets a maximum width of an element
  • the min-width property
    that sets a minimum width of an element
byenru