To enhance the layout of the flexboxes shown in your initial image, my suggestion would be to restructure them. Currently, you have 3 flexboxes, each functioning as a row with two items.
The optimal approach would involve creating a top-level flexbox that encapsulates all the elements. Within this top-level flexbox, establish 2 flexbox columns by utilizing flex-direction: column
, with each column containing 3 elements. The first column should consist of blocks 1, 3, and 5, while the second column should include 2, 4, and 6. If the screen size is large, the parent flexbox can position these inner flexboxes side by side. By incorporating flex-wrap: wrap
into the parent flexbox, when the screen size decreases, the second column will then be pushed below the first.
To implement a custom breakpoint, utilize a media query. As the screen size surpasses this designated breakpoint, modify the flex-direction
property within the parent flexbox to switch to flex-direction: column
.