CSS min-height property

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;

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;

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;

+ve length

The height of element should be at least 300px.

min-height: 300px;

+ve percentage

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

min-height: 30%;

auto

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

min-height: auto;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?

 

This is the first child element.

This is the second child element.

×

Ctrl+D