Using flexbox
is very simple, you just need a container for these three div
elements.
Let's define a div with a .box
class and add the div
elements. Also let's add three classes for the colors: .red
, .green
and .blue
and two classes to handle the columns left
and right
.
<div class="box">
<div class="left red"></div>
<div class="right green"></div>
<div class="right blue"></div>
</div>
Now we define the box
class as a flexbox:
.box {
display: flex;
...
}
Then we define the direction as column
(vertical) and if it can be flowed wrap
:
.box {
...
flex-flow: column wrap;
...
}
Also, we can define the dimensions of the div
elements. left
will be 45%
of the parent width
and 100%
of the parent height
.
.left {
width: 45%;
height: 100%;
}
While right
will be 55%
of the parent width
and 50%
(half) of the parent height
.
.right {
width: 55%;
height: 50%;
}
Full example:
.box {
display: flex;
flex-flow: column wrap;
width: 400px;
height: 100px;
}
.red {
background: #cc092f;
}
.green {
background: #09cc69;
}
.blue {
background: #0980cc;
}
.left {
width: 45%;
height: 100%;
}
.right {
width: 55%;
height: 50%;
}
<div class="box">
<div class="left red"></div>
<div class="right green"></div>
<div class="right blue"></div>
</div>