First of all: thank you for your time!
I'm looking to make a blog with Flex boxing. I've been looking at several places (here, here, here, here, here and here) but I can't get the "blog" effect I want. I'm looking to make a two column layout that could be made with flex-direction: column;
.
Unfortunately this would result in a column of the most recent posts with a column of much older posts on its side. If I wan't to keep the time-line of the blog relevant I feel like I'll need to use flex-direction: row;
in combination with flex-wrap: wrap;
.
This option works well with same-height posts but results in lost space when the heights varies.
On the left-side is my current result, on the right-side the desired one:
I realize that this is clearly a grid that requires two columns rather than rows. But is there a way to make the align-items
and align-content
properties achieve this kind of layout on a row-based Flex box (and this without Javascript)? Or, if it is impossible like this would suggest,is there a work-around to use columns but keep the time-line relevant? Should I use something else than Flex?
This is my current situation made as simple as possible:
.container{
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
}
.container div{
border: 1px solid black;
width: 40%;
}
<div class="container">
<div>
1
</div>
<div>
2
</div>
<div>
3
<br/>
<br/>
<br/>
</div>
<div>
4
</div>
<div>
5
</div>
</div>
Thank you,
Maxime