Web4College

CSS min-height property

src

Description

CSS min-height specifies the minimum height of an element.

It represents the minimum height of an element no matter whether the content is present or not.

Syntax

min-height : none | min-content | max-content | +ve length | +ve percentage | auto

Property values

noneDefault

No limit of height is applied to an element.

min-height: none;
Try it

min-content

min-content value specifies that the minimum height of element must be equal to or greater than the largest minimum height of some descendant item.

min-height: min-content;
Try it

max-content

max-content value represents that the minimum height of element must be equal to or greater than the largest maximum height of some descendant item.

min-height: max-content;
Try it

+ve length

300

The height of element should be at least 300px.

min-height: 300px;
Try it

+ve percentage

30

The height of element should be at least 30% of the parent box.

min-height: 30%;
Try it

auto

auto value means the height will be changed automatically according to the content.

min-height: auto;
Try it

Applicable to

It applies to all elements