Easy Tutorial
❮ Func Min Css Functions ❯

CSS max-height Property

Example

Set the maximum height of a paragraph:

p {
    max-height: 50px;
}

Property Definition and Usage

The max-height property sets the maximum height of an element.

Note: The max-height property does not include padding, border, or margin!

Default value: none
Inherited: no
--- ---
Version: CSS2
--- ---
JavaScript syntax: object.style.maxHeight="10px"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
max-height 1.0 7.0 1.0 2.0.2 7.0

Property Values

Value Description
none Default. No limit is set on the maximum height of the element.
length Defines the maximum height of the element.
% Defines the maximum height as a percentage of the containing block's height.
inherit Specifies that the value of the max-height property should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Dimension

CSS Reference: min-height Property

❮ Func Min Css Functions ❯