<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7" -->

---
title: Balancing flex items with flex-wrap: balance | daily.dev
description: A new CSS property, flex-wrap: balance, shipped in Chrome 150, solves the common problem of a lone flex item wrapping onto its own line by distributing items...
canonical: https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Balancing flex items with flex-wrap: balance | daily.dev
og:description: A new CSS property, flex-wrap: balance, shipped in Chrome 150, solves the common problem of a lone flex item wrapping onto its own line by distributing items...
og:url: https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7
og:image: https://api.daily.dev/og/posts/vYFWzD9N7.png
og:image:alt: Balancing flex items with flex-wrap: balance
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Balancing flex items with flex-wrap: balance

**[Ahmad Shadeed](https://daily.dev/sources/ishadeed)** · 9 min read · 8 upvotes · 0 comments

## Summary

A new CSS property, flex-wrap: balance, shipped in Chrome 150, solves the common problem of a lone flex item wrapping onto its own line by distributing items evenly across lines instead of using media queries. The piece walks through a real-world Buffer.com layout bug and demonstrates four workaround techniques (container queries, conditional clamp with max-width, display: contents, and pseudo-element ordering) before showing the simple balance solution. It also covers a companion property, flex-line-count, which forces a minimum number of wrap lines, and explores using it to build masonry-like layouts with round() and container query units.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ishadeed.com/article/flex-wrap-balance>

## Questions this post answers

### What does the CSS flex-wrap: balance property do and which browser supports it?

Flex-wrap: balance distributes wrapped flex items evenly across lines instead of leaving a single orphan item stranded on the last line, and it shipped in Chrome 150. It requires no media queries or JavaScript workarounds, replacing hacks like container-query-based max-width calculations or display: contents tricks used to fake the same balanced effect in other browsers.

_Developers tracking new CSS wrapping behavior like flex-wrap: balance can follow browser support changes on daily.dev._

### What does the flex-line-count CSS property do?

Flex-line-count sets a minimum number of lines that flex items must wrap into, even when there is enough horizontal space for everything to fit on one line. Combined with flex-wrap: balance, it lets a navigation menu or masonry-style layout force multiple lines without restricting the container's max-width, unlike traditional max-width based wrapping tricks.

_Anyone experimenting with forced multi-line flex layouts can track properties like flex-line-count on daily.dev._

### How can flex-wrap and flex-line-count be combined to build a masonry-style layout without CSS grid?

Setting flex-direction: column with flex-wrap: balance and flex-line-count creates masonry-like columns, using a CSS custom property calculated with clamp() and round(down, 100cqw / cardWidth) to determine column count responsively based on container width. This avoids CSS grid's native masonry syntax but the reading order does not match the visual order, a known limitation of the technique.

_Front-end developers weighing flexbox versus grid for masonry layouts can compare approaches on daily.dev._

## Similar posts on daily.dev

- [New CSS Multi-Column Layout Features in Chrome](https://daily.dev/posts/new-css-multi-column-layout-features-in-chrome-2qctatt1l) · CSS-Tricks · 20 upvotes · 1 comments
- [How to Use Flex in Tailwind CSS and Justify Flex Items](https://daily.dev/posts/how-to-use-flex-in-tailwind-css-and-justify-flex-items-wigqmkowt) · freeCodeCamp · 2 upvotes · 0 comments
- [Chris’ Corner: Type](https://daily.dev/posts/chris-corner-type-k8fst8gqg) · CodePen · 0 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#ui-design](https://daily.dev/tags/ui-design), [#google-chrome](https://daily.dev/tags/google-chrome)

[View this post on daily.dev](https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Balancing flex items with flex-wrap: balance","url":"https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7"},"datePublished":"2026-08-25T15:53:03.507Z","dateModified":"2026-09-14T07:31:49.873Z","description":"A new CSS property, flex-wrap: balance, shipped in Chrome 150, solves the common problem of a lone flex item wrapping onto its own line by distributing items...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/55754a0fd1f96c1b2cd792cc8b668f17?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/55754a0fd1f96c1b2cd792cc8b668f17?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Ahmad Shadeed","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ahmad Shadeed","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/2bcc7ec837854040856ba4a4eb8946d0","url":"https://daily.dev/sources/ishadeed"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,ui-design,google-chrome","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ahmad Shadeed","item":"https://daily.dev/sources/ishadeed"},{"@type":"ListItem","position":3,"name":"Balancing flex items with flex-wrap: balance"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/balancing-flex-items-with-flex-wrap-balance-vyfwzd9n7#faq","mainEntity":[{"@type":"Question","name":"What does the CSS flex-wrap: balance property do and which browser supports it?","acceptedAnswer":{"@type":"Answer","text":"Flex-wrap: balance distributes wrapped flex items evenly across lines instead of leaving a single orphan item stranded on the last line, and it shipped in Chrome 150. It requires no media queries or JavaScript workarounds, replacing hacks like container-query-based max-width calculations or display: contents tricks used to fake the same balanced effect in other browsers. Developers tracking new CSS wrapping behavior like flex-wrap: balance can follow browser support changes on daily.dev."}},{"@type":"Question","name":"What does the flex-line-count CSS property do?","acceptedAnswer":{"@type":"Answer","text":"Flex-line-count sets a minimum number of lines that flex items must wrap into, even when there is enough horizontal space for everything to fit on one line. Combined with flex-wrap: balance, it lets a navigation menu or masonry-style layout force multiple lines without restricting the container's max-width, unlike traditional max-width based wrapping tricks. Anyone experimenting with forced multi-line flex layouts can track properties like flex-line-count on daily.dev."}},{"@type":"Question","name":"How can flex-wrap and flex-line-count be combined to build a masonry-style layout without CSS grid?","acceptedAnswer":{"@type":"Answer","text":"Setting flex-direction: column with flex-wrap: balance and flex-line-count creates masonry-like columns, using a CSS custom property calculated with clamp() and round(down, 100cqw / cardWidth) to determine column count responsively based on container width. This avoids CSS grid's native masonry syntax but the reading order does not match the visual order, a known limitation of the technique. Front-end developers weighing flexbox versus grid for masonry layouts can compare approaches on daily.dev."}}]}
```

