Style minHeight Property
Example
Set the minimum height of a <div> element:
document.getElementById("myDIV").style.minHeight = "100px";
Try it Yourself »
Definition and Usage
The minHeight property sets or returns the minimum height of an element.
The minHeight property has effect only on block-level elements or on elements with absolute or fixed position.
Tip: To set or return the maximum height of an element, use the maxHeight property.
Browser Support
Property | |||||
---|---|---|---|---|---|
minHeight | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the minHeight property:
object.style.minHeight
Set the minHeight property:
object.style.minHeight = "length|%|initial|inherit"
Property Values
Value | Description |
---|---|
length | Defines the minimum height in length units. Default is 0 |
% | Defines the minimum height in % of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technical Details
Default Value: | 0 |
---|---|
Return Value: | A String, representing the minimum height of an element |
CSS Version | CSS2 |
More Examples
Example
Return the minimum height of a <div> element:
alert(document.getElementById("myDiv").style.minHeight);
Try it Yourself »
Related Pages
CSS tutorial: CSS Dimension
CSS reference: min-height property