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

Why do CSS Grid columns become too narrow or overflow?

Illustration without a description Illustration without a description

CSS Grid columns become too narrow when flexible tracks share less space than their contents need, and they overflow when an item’s minimum size prevents the track from shrinking. Long text, images, form controls and min-width values can all establish a larger min-content width.

 

A track declared as 1fr still has an automatic minimum in many layouts. Replace it with minmax(0, 1fr) when the track should shrink below its content-based minimum. Add min-width: 0 to the grid item if a nested child continues forcing overflow.

 

.layout {
display: grid;
grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
}

.layout > * { min-width: 0; }

 

The content still needs a policy. Wrap long URLs, scale images, allow labels to break and give tables or code blocks an intentional local scroller. Resetting the minimum can otherwise turn page overflow into clipped content inside a narrow track.

 

Inspect the grid overlay and computed track sizes at the failing width. Check gaps and container padding as well as columns. If a column’s useful minimum no longer fits, stack the layout at a content-driven breakpoint instead of compressing it until text, controls or targets become unusable. Add this case to responsive regression tests with long content, browser zoom and at least one narrow embedded container. Record the expected wrapping and focus behavior so later component changes can be checked against a known result. Add this case to responsive regression tests with long content, browser zoom and at least one narrow embedded container. Record the expected wrapping and focus behavior so later component changes can be checked against a known result.