<div class="box">
<div class="A">A</div>
<div class="B">B</div>
<div class="C">C</div>
</div>
What about A's and B's height? Is it fixed or it varies depending on the content or something else?
The height of the content inside of A will not change, but the height of the content inside of B will change. .box height should equal max(height A, height B + C)
Here's a pen where everything is stubbed out
Your result is conceptually simple, but you need to use more than just 3 consecutive elements to accomplish what you want. Flex box is the bee's knees but it can't magic your layout. You need a separate sub-layout.
HTML
<div class="box flex">
<div class="a">A</div>
<div class="b-c flex column">
<div class="b">B</div>
<div class="c"></div>
</div>
<div>
CSS
.box {
display: flex;
align-items: stretch;
width: 100vw;
}
.a {
flex: 0 0 150px;
}
.b-c {
flex-direction: column;
display: flex;
flex-grow: 1;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With