The CSS reference
"min-height" - css property (v. css 2)
- Sets the minimum height of an element.
- Together with 'max-height' it constrain the height of elements to a certain range.
- If the computed value of 'min-height' is greater than the value of 'max-height', 'max-height' is set to the value of 'min-height'.
- If the computed height is greater than 'max-height', the rules above are applied again, but this time using the value of 'max-height' as the specified value for 'height' .
- If the computed height is smaller than 'min-height', the rules above are applied again, but this time using the value of 'min-height' as the specified value for 'height'.
- Initial value: 0
- The property is not inherited
- HTML usage: All elements except non-replaced inline elements and table elements
-
Browsers that support the min-height - property :
Possible min-height or max-height values:
values | Comments | CSS |
---|---|---|
length | With this you specify a positive value followed with a unit identifier for a fixed minimum or maximum computed height (it cannot be negative). | 1 |
percentage | With this you specify a value with a percentage. It refer to min-height or max-height of containing block. If the height of the containing block is not specified explicitly, and this element is not absolutely positioned, the percentage value is treated as initial. | 2 |
none | This is only on 'max-height'. It means there is no limit on the height of the box. | 2 |
inherit | Will inherit the value from parent specification. | 2 |
Possible unit identifier:
unit identifier | Comments | CSS |
---|---|---|
em | The relative unit 'em' is relative to the font size of the element itself. | 1 |
ex | The relative unit 'ex' is relative to the font size of the element itself. | 1 |
px | Pixels, relative to the viewing device | 1 |
in | inches -> 1 inch is equal to 2.54 centimeters. | 1 |
cm | centimeters. | 1 |
mm | millimeters. | 1 |
pt | points -> the points used by CSS2 are equal to 1/72th of an inch. | 1 |
pc | picas -> 1 pica is equal to 12 points. | 1 |
Javascript access:
// To SET values ([o] is the target object)
[o].style.minHeight="min-height value"
// To GET values you must first get the computed style object
// To get that object in IE or Opera:
var cStyle=[o].currentStyle;
// To get that object in Firefox, Chrome or Safari (w3c-type):
var cStyle=window.getComputedStyle([o],null)
// To GET the property value:
var value=cStyle.minHeight;
// IE and Opera will return a value in units as used with a Set.
// Firefox will return a calculated float value in pixel (px).
// Chrome or Safari will return a calculated int value in pixel (px).
© 2010 by Finnesand Data.
All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.