CSS max-height property

Examples

Set paragraph Maximum height:

p
{
max-height:50px;
}


Attribute definitions and instructions

Sets the maximum height of the element max-height property.

Note: max-height property does not include padding, borders, or margins!

Defaults: none
inherit: no
version: CSS2
JavaScript syntax: object .style.maxHeight = "10px"


Browser Support

Figures in the table represent the first browser to support the version number of the property.

属性
max-height 1.0 7.0 1.0 2.0.2 7.0

Property Value

value description
none default. Definition does not limit the maximum height of the element is allowed.
length The maximum height values ​​that define the element.
% Definition is based on the percentage of the containing block-level objects maximum height.
inherit Provisions should inherit the max-height property value from the parent element.


related articles

CSS tutorial: CSS a Dimension

CSS Reference: min-height property