min-width sets a lower bound on physical width. It constrains width and can override a conflicting max-width. It does not mean “stop expanding.”
A minimum larger than width
The box declares width:80px and min-width:160px. The minimum wins, so its border box is 160px with this box-sizing rule.
HTML and CSS
HTML
<div class="box">Minimum: 160px</div>
CSS
.box {
box-sizing: border-box;
width: 80px;
min-width: 160px;
padding: 1rem;
background: #dbeafe;
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Let a flex item wrap
A flex item’s automatic minimum can preserve an unbroken string’s intrinsic width. The explicit zero allows this item to shrink; overflow-wrap then gives the text a way to wrap.
HTML and CSS
HTML
<div class="row">
<div class="content">averylongregistrationidentifierwithoutspaces</div>
<span class="badge">New</span>
</div>
CSS
.row {
display: flex;
gap: 0.5rem;
max-width: 18rem;
border: 1px solid #94a3b8;
}
.content {
flex: 1;
min-width: 0;
overflow-wrap: anywhere;
background: #eff6ff;
}
.badge {
flex: 0 0 auto;
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Automatic minimums and values
The initial value is auto and min-width is not inherited. In ordinary block layout, auto usually resolves to zero. Flex and Grid automatic minimums can depend on content, specified sizes, aspect ratios, scroll-container status, and grid-track spanning. Do not describe auto as universally “no clamp.”
Lengths, percentages of the containing block’s width, and intrinsic values are useful. Zero is an explicit minimum, not a command to hide overflowing content. Negative minimum widths are invalid; newer stretch or sizing functions need separate support checks.
Why a layout still overflows
Min-width:0 allows shrinking but does not wrap an unbreakable child automatically. Pair it with suitable wrapping or scrolling. A large fixed minimum can force horizontal scrolling on mobile. Learn flex-shrink, overflow-wrap, and max-width for the surrounding constraints.
Sources and browser support
MDN: min-width describes the syntax and links to the specification and compatibility data. Check individual values in that table when supporting older browsers.