English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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" |
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‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
length | The specified minimum height, in units of px, pt, cm, em, etc. Negative values are not allowed. |
percentage | Specify 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. |
initial | Set this property to its default value. |
inherit | If specified, the associated element adopts its parent element's min-The value of the height attribute. |
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.
|
Please refer to the tutorials related to the following content:CSS Box Model,CSS dimensions.
Related properties:height,max-height.