Style minHeight property
- Rejea kipenyo chifuatayo maxWidth
- Pya kuzingatia minWidth
- Rejea kipenyo chifuatayo Mwongozo wa Style ya HTML DOM
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
Example
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 also initial. |
inherit | Inherit this property from its parent element. See also inherit. |
Technical details
Default value: | 0 |
---|---|
Return value: | A string representing the minimum height of an element. |
CSS Version: | CSS2 |
Muungano wa vifaa vya kusoma
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Mwongozo | Mwongozo | Mwongozo | Mwongozo | Mwongozo |
- Rejea kipenyo chifuatayo maxWidth
- Pya kuzingatia minWidth
- Rejea kipenyo chifuatayo Mwongozo wa Style ya HTML DOM