Web4College

CSS min-width property

src

Description

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

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

Syntax

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

Property values

noneDefault

No limit of width is applied to an element.

min-width: none;
Try it

min-content

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

min-width: min-content;
Try it

max-content

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

min-width: max-content;
Try it

+ve length

300

The width of element should be at least 300px.

min-width: 300px;
Try it

+ve percentage

30

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

min-width: 30%;
Try it

auto

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

min-width: auto;
Try it

Applicable to

It applies to all elements