I am trying to make a special in a row of flexboxes stretch to be the height of two rows. Here is what I am trying to achieve: What I want. But here is my current result: Result.
I think I have to use flex-wrap: wrap;
, but I am not sure. I don't want to do flex-direction: column;
, because then I cannot stretch the divs at the top like if they were aligned in a row. I want all the children divs to be part of the same flex container. Does anyone have any ideas?
Note : I found this, where I was able to create this. If somehow I can move the Three up to be next to the Two, I may be able to achieve what I want. Not sure how to do this.
Here is my code I am using:
.flex-row {
display: flex;
flex: 1;
flex-direction: row;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.flex-col {
margin: 5px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
display: flex;
justify-content: center;
align-items: center;
flex: 1;
flex-direction: column;
padding: 10px;
box-sizing: border-box;
}
<div class="flex-row">
<div class="flex-col">
<p>This box has little text.</p>
</div>
<div class="flex-col">
<p>This box is diffrent than small. It has a middleish amout of text.</p>
</div>
<div class="flex-col">
<p>This box is diffrent than small and middleish. It has a lot of text. Thus, I want it to continue onto the next row of flexboxes.</p>
</div>
<div class="flex-col">
<p>This box has little text.</p>
</div>
<div class="flex-col">
<p>This box is diffrent than small. It has a middleish amout of text.</p>
</div>
</div>
Thank you.