minHeight style property
Specifies or returns a minimum height for the visible area of an element.
This property has effect only on block-level elements or on elements with absolute or fixed position. The minHeight property contains only the pure height of the visible content, without the padding, scrollbar, border and the margin. The height of an element can never be less than the value specified by the minHeight property.
The properties mentioned above can be used to access style settings. If you need the height of a rendered element, you can use the clientHeight, offsetHeight and scrollHeight properties or the getBoundingClientRect method.
You can find the related objects in the Supported by objects section below.
This property is read/write.
|CSS page for this property: min-height|
The type of this property is string.
One of the following values:
|The minimum height for the element in length units. For the supported length units, see the length page.|
|The minimum height for the element is the specified percentage of the height of the parent element.|
|Takes the value of this property from the computed style of the parent element.|
Example HTML code 1:
This example illustrates the use of the min-height property:
Example HTML code 2:
This example is equivalent to the previous one, but it uses the HTML 4.01 Transitional document type so the min-height property does not work for td elements in Internet Explorer before version 8:
Example HTML code 3:
User Contributed Comments