Style minHeight Property
- Previous Page maxWidth
- Next Page minWidth
- Go to Parent Layer HTML DOM Style Object
Definition and Usage
minHeight
Property sets or returns the minimum height of an element.
minHeight
This property is only effective 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
Returns 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"
Property 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 | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical Details
Default value: | 0 |
---|---|
Return value: | A string representing the minimum height of an element. |
CSS Version: | CSS2 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page maxWidth
- Next Page minWidth
- Go to Parent Layer HTML DOM Style Object