English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete List of CSS Properties

CSS min-Usage and examples of height attribute

min-The height CSS attribute specifies the minimum height of the content area of the element. This minimum height does not include padding, border, or margin.-Please refer toCSS box model.

The following table provides usage instructions and version history for this attribute, as well as the syntax for using this attribute in JavaScript scripts.

Default value:0
Applies to:Except for non-replaced embedded elements,
All elements except table rows and row groups
Inheritance:No
Animated:Yes.Please refer to Animation attributes.
Version:CSS 2、3
JavaScript syntax:object.style.minHeight="100px"

min-The syntax of height usage

The syntax of this attribute is as follows:

min-height: length | percentage | initial | inherit

The following example demonstrates how to use min-height attribute.

  p {
   min-height: 100px;
  }
  div {
   height: 200px;
   min-height: 300px;
  }
Test and see‹/›

Attribute value

The following table describes the value of this attribute.

ValueDescription
lengthThe specified minimum height, in units of px, pt, cm, em, etc. Negative values are not allowed.
percentageSpecify the minimum height as a percentage. The percentage is calculated relative to the height of the element's containing block. Negative percentage values are not allowed.
initialSet this property to its default value.
inheritIf specified, the associated element adopts its parent element's min-The value of the height attribute.

Browser compatibility

min-The compatibility of the height attribute of browsers, the numbers in the table below represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 7+

  • Apple Safari 1+

  • Opera 7+

Read more

Please refer to the tutorials related to the following content:CSS Box Model,CSS dimensions.

Related properties:height,max-height.