Style minHeight property

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";

Try it yourself

Example 2

Return the minimum height of the <div> element:

alert(document.getElementById("myDiv").style.minHeight);

Try it yourself

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 with a length unit. 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: A string representing the minimum height of an element.
CSS version: CSS2

Browserkompatibilitet

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support