I want to render 2 column on a site. I have managed to set this up with a flexbox system. The issue I have is that not all the elements are equal height, and this causes some huge whitespaces. Ideally I would like to have the left column to ignore these whitespaces and move them up a bit. Here you can find the code of how it looks like now:
.flex-wrapper {
display: flex;
flex-wrap: wrap;
}
.wide {
width: 75%;
height: 100px;
margin-bottom: 10px;
}
.small {
width: 25%;
height: 150px;
}
.red {
background-color: tomato;
height: 100%;
}
.blue {
background-color: royalblue;
height: 100%;
}
.flex-wrapper > block-action:nth-of-type(1) {
order: 1;
}
.flex-wrapper > block-action:nth-of-type(2) {
order: 5;
}
.flex-wrapper > block-action:nth-of-type(3) {
order: 9;
}
.flex-wrapper > block-action:nth-of-type(4) {
order: 13;
}
<div class="flex-wrapper">
<div class="wide" style="order: 0">
<div class="red"></div>
</div>
<div class="wide" style="order: 2">
<div class="red"></div>
</div>
<div class="wide" style="order: 4">
<div class="red"></div>
</div>
<div class="wide" style="order: 6">
<div class="red"></div>
</div>
<div class="wide" style="order: 8">
<div class="red"></div>
</div>
<div class="wide" style="order: 10">
<div class="red"></div>
</div>
<div class="wide" style="order: 12">
<div class="red"></div>
</div>
<div class="wide" style="order: 14">
<div class="red"></div>
</div>
<block-action class="small">
<div class="blue"></div>
</block-action>
<block-action class="small">
<div class="blue"></div>
</block-action>
<block-action class="small">
<div class="blue"></div>
</block-action>
</div>
The image below should give you an idea of what I actually want.
I've founds way to do this with a flexbox, but they always set the order property. This is an issue for me however because the order is already set dynamically by some JS code, so it would overwrite that and break stuff.