Style minHeight attribute
- Föregående sida maxWidth
- Nästa sida minWidth
- Gå tillbaka till föregående nivå HTML DOM Style-objekt
Definition and usage
minHeight
Property sets or returns the minimum height of an element.
minHeight
This property is only valid for block-level elements or elements with absolute or fixed positioning.
Tip:To set or return the maximum height of an element, use maxHeight property.
See also:
CSS Tutorial:CSS Dimension
CSS Reference Manual:min-height property
Instance
Example 1
Set the minimum height of the <div> element:
document.getElementById("myDIV").style.minHeight = "100px";
Example 2
Return the minimum height of the <div> element:
alert(document.getElementById("myDiv").style.minHeight);
Syntax
Return minHeight property:
object.style.minHeight
Set minHeight property:
object.style.minHeight = "length|%|initial|inherit"
Attribute value
Value | Description |
---|---|
length | Define the minimum height in length units. Default is 0. |
% | Define the minimum height in percentage of the parent element. |
initial | Set this property to its default value. See initial. |
inherit | Inherit this property from its parent element. See inherit. |
Technical details
Default value: | 0 |
---|---|
Return value: | String that represents the minimum height of an element. |
CSS version: | CSS2 |
Webbläsarstöd
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida maxWidth
- Nästa sida minWidth
- Gå tillbaka till föregående nivå HTML DOM Style-objekt