I've a flow on a page with several divs (I'm using flex position, using the row direction) the structure is pretty "fixed" with set heights.. Everything flows as it should, but I was wondering if someone knows a way to fill up the empty gap (of course this isn't the row direction for that part so that's probably why it doesn't work)
https://jsfiddle.net/benvanlooy/2z8b5tzw/6/
I want 6 to be placed under 5... (see fiddle below)
- I don't think it's possible using purely css.. but that's what I really would like.
- I don't want to use javascript to fix this (I know such things are possible with Isotype and such)
any help would be much appreciated
html
<div class="post-wrapper">
<div class="post">1</div>
</div>
<div class="post-wrapper">
<div class="post">2</div>
</div>
<div class="post-wrapper fourth">
<div class="post">3</div>
</div>
<div class="post-wrapper fourth">
<div class="post">4</div>
</div>
<div class="post-wrapper">
<div class="post">5</div>
</div>
<div class="post-wrapper">
<div class="post">6</div>
</div>
<div class="post-wrapper">
<div class="post">7</div>
</div>
</div>
css
.container{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.container .post-wrapper{
padding: 10px;
width: 50%;
height: 200px;
box-sizing: border-box;
}
.container .post-wrapper.fourth{
width: 25%;
height: 410px;
}
.container .post-wrapper .post{
background-color: #cccccc;
width: 100%;
height: 100%;
}