Not deprecated. Classic values nowrap, wrap, and wrap-reverse are widely supported. The newer balance keyword has limited support — treat it as optional for now.
Still a wrapping row. Items can use more than one line.
Flip the cross axis.wrap-reverse reverses where new lines start.
First line sits lower. In a default row, the first filled line appears toward the bottom.
Same item order on each line. Only the stacking of lines is reversed.
Edge Cases & Pitfalls
If wrapping seems broken, check these first.
container
Set it on the flex container
flex-wrap on a child does nothing useful. The parent needs display: flex.
space
No squeeze, no wrap
If the row is wide enough for every item, wrap and nowrap look the same. Narrow the container to see the difference.
align
align-content needs multiple lines
align-content only distributes flex lines when wrapping creates more than one line and spare cross-axis space exists.
shrink
Items may shrink instead of wrap
With nowrap, flex-shrink can squeeze items to fit. Fixed widths (or flex-shrink: 0) make overflow clearer for demos.
balance
balance is newer
Even line filling with flex-wrap: wrap balance is not widely supported yet. Stick to wrap / wrap-reverse for production today.
Compatibility
Browser Support
flex-wrap is a browser CSS property for Flexbox containers. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
flex-wrap
nowrap / wrap / wrap-reverse: Chrome 29+, Firefox 28+, Safari 9+, Edge 12+. Internet Explorer 11 supports flex-wrap. The balance keyword is newer and limited.
Bottom line: Safe for modern and IE11 flex layouts with nowrap, wrap, and wrap-reverse. Avoid relying on balance until support is broader. It is not a runtime API.
Remember
Key Takeaways
Role: one line vs multiple lines for flex items.
Default:nowrap — overflow instead of new lines.
Common fix:flex-wrap: wrap for responsive rows of cards or chips.
Container only: not inherited; set on display: flex.
One line: narrow flex row + flex-wrap: wrap; = items drop to the next line instead of overflowing.
Frequently Asked Questions
It controls whether flex items stay on one line or wrap onto extra lines when they do not fit in the flex container along the main axis.
The initial value is nowrap. All items stay on one line and may overflow the container.
Both allow multiple lines. wrap stacks new lines in the normal cross-axis direction. wrap-reverse stacks lines in the opposite cross-axis direction.
Set it on the flex container — the element with display: flex or display: inline-flex — not on each item.
align-content positions multiple flex lines when there is spare cross-axis space. It only matters when flex-wrap allows more than one line.
It is Baseline Widely available. Chrome 29+, Firefox 28+, Safari 9+, and Edge 12+ support the classic values. Internet Explorer 11 supports flex-wrap with the standard name. It is a browser CSS property, not a Node.js feature.