r/webdev • • Feb 18 '26

flexbox combine wrapping with different sized items in height

I have a 2 column layout, and I want the right column to wrap the items inside which vary in height.

I tried the following:

  • switching to display types: flex, inline-block, block
  • using row or column flexbox direction
  • changing flexbox centering
  • giving the lists fixed heights and widths in %
  • giving the lists fixed heights and widths in px
  • pulling my hair several times

what I want to achieve in the overview-content right column have the small lists wrap and become 2 or more on one column, and have the big list on it's own column, depending on the screen width.

e.g.:

Small list BIG LIST small list
Small list ........ small list

this the code I struggled with: https://jsfiddle.net/qos0pdn1/11/

Right now they either are all on the same row, or all on the same column, and don't appear to flow underneath eachother depending on the height.

the list number and length will vary, sometimes it can be 2 big lists, so the solution needs to look at list height and decide wether to wrap the list or not.

1 Upvotes

9 comments sorted by

1

u/cshaiku Feb 18 '26

1

u/nemuro87 Feb 18 '26

thanks, but it appears to be an experimental feature, and not yet compatible across the majority of browsers.

→ More replies (1)

2

u/[deleted] Feb 18 '26

[removed] — view removed comment

1

u/nemuro87 Feb 18 '26

Thanks, I've gotten this far: https://jsfiddle.net/afy8m34b/7/

I ran into 2 issues:

  1. there is enough space between the lists so that another list can fit
  2. I was expecting small list 1 & 2 to be underneath eachother since that's the order they are in HTML