\n CSS min-height Property\n
\n\nInstance
\nSet the minimum height of a paragraph:
\nInstance
\np {\n min-height: 150px;\n}\n Try It Yourself Β»\n
\n\n\n
Definition and Usage
\nmin-height property sets the minimum height of an element.
Note: The min-height property does not include padding, borders, or margins!
| Default value: | \nnone | \n
|---|---|
| Inherited: | \nno | \n
| Animatable: | \nyes, see individual properties. Read about animatable | \n
| Version: | \nCSS2 | \n
| JavaScript syntax: | \nobject.style.minHeight="100px" Try it Β» | \n
\n
Browser Support
\nThe numbers in the table specify the first browser version that fully supports the property.
\n| Property | \n|||||
|---|---|---|---|---|---|
| min-height | \n1.0 | \n7.0 | \n3.0 | \n2.0.2 | \n7.0 | \n
\n
CSS Syntax
\nmin-height: length|initial|inherit;\n \n
Property Values
\n| Value | \nDescription | \n\n |
|---|---|---|
| length | \nDefines the minimum height in px, cm, etc. Default is 0. See length units | \nTry it | \n
| % | \nDefines the minimum height as a percentage of the containing block | \nTry it | \n
| initial | \nSets this property to its default value. Read about initial | \nTry it | \n
| inherit | \nInherits this property from its parent element. Read about inherit | \n\n |
\n
More Instances
\nInstance
\nThis example demonstrates how to use a pixel value to set the minimum height of an element.
\np {\n min-height: 50px;\n}\n Try It Yourself Β»\n
\nInstance
\nThis example demonstrates how to use a percentage value to set the minimum height of an element.
\np {\n min-height: 10%;\n}\n Try It Yourself Β»\n
\nInstance
\nSet the minimum height to initial.
\np {\n min-height: initial;\n}\n Try It Yourself Β»\n
\n\n
Related Pages
\nCSS tutorial: CSS Height and Width
\nCSS reference: max-height property
\nCSS reference: height property
\n\n
YouTip