CSS min-width property
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;
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;
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;
+ve length
-
The width of element should be at least 300px.
min-width: 300px;
+ve percentage
-
The width of element should be at least 30% of the parent box.
min-width: 30%;
auto
-
auto value means the width will be changed automatically according to the content.
min-width: auto;
Applicable to
It applies to all elements
From web4college, the free CSS digger
#CSS digger
Was this article helpful?
This is the first child element.
This is the second child element.