Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1314

How to merge flex columns into larger columns to prevent overly stretching? [duplicate]

$
0
0

I have this situation where some columns are really large and others are smaller and I would like to merge these smaller ones not to waste space.

The container div has flex direction row and the columns are div's as well. This is the normal behaviour, but how do I change this to my desired outcome?

A picture says more than a thousand words.

enter image description here

Snippet

#container { display: flex; flex-flow: row wrap; background: red; width: 300px; }#container div { background: blue; width: 100px; height: 40px; }#container div.large { background: green; height: 200px; }
<div id="container"><div>1</div><div>2</div><div class="large">3</div><div>4</div><div>5</div><div>6</div></div>

Found it in -duplicate- question answers

https://w3bits.com/flexbox-masonry/ -> Vertical Flexbox Masonry

display: flex;flex-flow: column wrap;max-height: 800px;margin-left: -8px; /* Adjustment for the gutter */width: 100%;

Viewing all articles
Browse latest Browse all 1314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>