When should a layout use width, max-width or min-width?

Use width to set a preferred or definite size, max-width to prevent excessive growth and min-width to prevent harmful shrinking. Responsive layouts often combine a fluid width with a maximum, while using minimums sparingly because they can create overflow.
A page container commonly uses width: 100% plus a readable max-width. Images use max-width to stay inside their parent. Buttons may use a minimum inline size for target comfort while allowing their text and padding to make them wider.
.page {
width: min(100% – 2rem, 72rem);
margin-inline: auto;
}
.field {
width: 100%;
max-width: 32rem;
}
Avoid putting a large min-width on the main page or a flex child that must shrink. The browser’s default min-content behavior can already keep long content from shrinking, which is why min-width: 0 often repairs flex and grid overflow.
Choose constraints from content. Ask how small the component can remain usable, how large it can grow before relationships become weak and whether the available container should determine the final size. Test missing content, long labels, zoom and nested placement before turning the values into design tokens. Keep the rule beside the component it controls and document the reason for the threshold or constraint. This makes future changes easier to evaluate and prevents an unrelated page stylesheet from silently overriding the responsive behavior. Test the solution with keyboard focus, touch input and a resized desktop window. Responsive geometry is only successful when every visible control remains reachable and the content keeps a logical reading order. Include the pattern in responsive regression tests with long content, browser zoom and at least one narrow embedded context. Record the expected wrapping and focus behavior so later component changes can be checked against a known result.