THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Style minHeight Property

Style Object Reference Style Object

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

Internet Explorer Firefox Opera Google Chrome Safari

The minHeight property is supported in all major browsers.


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


Style Object Reference Style Object