CSS min-height Property
Description
The min-height
property specifies the minimum height to be used for an element.
- Initial value0
- Applies toAll elements except non-replaced inline elements and table elements
- InheritedNo
- MediaVisual
- Computed valueThe percentage as specified or the absolute length
- AnimatableYes
- CSS VersionCSS2, CSS3
- JavaScript syntaxobject.style.minHeight
Syntax
Formal syntax: [ [<length> | <percentage>] && [border-box | content-box]? ] | available | min-content | max-content | fit-content min-height: 200px; min-height: 40%; min-height: min-content; min-height: max-content; min-height: fit-content;
Values
- <length>Specifies a fixed width. Negative values are not allowed.
- <percentage>A percentage relative to the width of the containing block. If the containing block has no width explicitly set then is is treated as none. Negative values are not allowed.
- max-contentThe max-content width or height.
- min-contentThe min-content width or height.
- availableThe containing block width or height minus margin, border, and padding.
- fit-contentIf the total available space is finite, equals to min(max-content, max(min-content, fill-available)). Otherwise, equal to the max-content measure. Requires CSS Intrinsic & Extrinsic Sizing Module support in browsers.
Example
.class { min-height: 50px; }
Browser Support
1+![]() | 7+![]() | 1+![]() | 1+![]() | 8+![]() |
View All CSS Properties
Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.