Explore Bato Web Agency Webflow Certified Partner Profile Explore Bato Web Agency Webflow Certified Partner Profile

Why does min-width: 0 fix an overflowing flex item?

Illustration without a description Illustration without a description

min-width: 0 fixes many flex overflows because flex items default to an automatic minimum size based on their content. That min-content constraint can be wider than the available space, so the item stops shrinking even though Flexbox is allowed to distribute negative space.

 

Resetting the minimum tells the browser that the flex item may become narrower than its contents’ preferred minimum. This is common for a text column beside an image, where a long title or nested element otherwise pushes the whole row beyond the viewport.

 

.item {
display: flex;
}

.item__content {
flex: 1 1 auto;
min-width: 0;
}

.item__title {
overflow-wrap: anywhere;
}

 

The rule does not solve the content by itself. Text still needs wrapping or deliberate truncation, images need size constraints and tables may need a local scroll container. If the child uses white-space: nowrap, the item can shrink while the text continues overflowing inside it.

 

Apply the reset to the flex child whose content establishes the minimum, not blindly to every element. The corresponding Grid fix is often min-width: 0 on a grid item or minmax(0, 1fr) for the track. Test focus and full content access after any truncation. Verify the final behavior across the full width range, including the spaces between preset devices and design breakpoints. Long labels, translated copy and enlarged text often reveal constraints that short demo content does not exercise. Recheck the component after font, spacing or browser-support changes. Responsive failures often return when a shared token changes, so the test should cover the limiting content state instead of one ideal screenshot.