I have one div
, which contains 3 divs, in flex-direction column.
Is there any way, I can make the bottom two red divs, sit next to each other (side by side). And not on top of each other? Like this:
I know I can store these two red divs in another row and set the direction to row.
But I wondered if this can be achieved, specifically with this html structure:
Thanks,
.main {
display: flex;
flex-direction: column;
width: 200px;
border: 1px solid black;
}
.top {
background-color: blue;
color: red;
width: 100%;
height: 50px;
}
.bottom {
background-color: red;
color: white;
width: 50%;
height: 50px;
}
<div class="main">
<div class="box top">Box 1</div>
<div class="box bottom">Box 2</div>
<div class="box bottom">Box 3</div>
</div>
<div class="main">
<div class="box top">Box 1</div>
<div class="box bottom">Box 2</div>
<div class="box bottom">Box 3</div>
</div>