Min-Width Property

Last updated: 2026-09-13

min-width Min-Width Property

The min-width property sets the minimum width of an element, preventing it from being compressed too small when the container narrows. Its default value, 0, means there is no lower limit. It is often used together with width and max-width and is an important tool for protecting readability in responsive layouts.

Category
Initial Value0
InheritedNo
Applies Tonon-replaced
Animation Typelength
CSS VersionCSS2
StatusStandard

📝 Syntax

min-width: auto | <length> | <percentage> | min-content | max-content | fit-content;

⚙️ Values

ValueTypeDescription
0KeywordNo minimum width.
<length>TypeA fixed minimum width.
<percentage>TypeA percentage relative to the containing block.

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
min-width v1 v12 v1 v1 v1
Supported in all major browsers
Tip: min-width takes precedence over width and max-width, forcing the element to never shrink below this value.

❓ FAQ

QIf both min-width and width are set, which one wins?
Amin-width has higher priority than width. When width is smaller than min-width, the element renders at min-width; when width is larger, it renders at width. min-width can even override max-width. The CSS size constraint order is min-width first, then max-width, then width, so min-width is the strongest of the three and protects content from being crushed on narrow screens. The same precedence applies to heights with min-height.
QWhy do flex items need min-width:0 to shrink?
ABecause a flex item's default min-width is auto, which behaves like the minimum width of its content, for example the longest word. When the container runs out of space, the item refuses to shrink below that, causing overflow or a broken layout. Setting min-width:0 allows the item to shrink freely, which is common for text truncation with text-overflow:ellipsis and for evenly split lists inside flex layouts.
QWhat is the difference between min-width and max-width?
Amin-width sets the lower bound of an element's width, preventing it from being squeezed narrower than the set value; max-width sets the upper bound, preventing it from being stretched wider than the set value. They can be used together, and the browser resolves the final width using the precedence min-width, then max-width, then width. Together they define the width range in responsive layouts.
QWhat is the min-width percentage relative to?
AThe percentage is computed against the containing block's width. For example, min-width:50% means the element can never be narrower than half of the parent's content area width. Note that for absolutely positioned elements the reference is the padding box of the nearest positioned ancestor, so check which containing block applies before relying on the computed ratio. In normal flow, that containing block is almost always the parent's content area.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏