I want to make a div
fill the remaining height of a parent container. I know that there are many other similar questions around and the common flexbox
solution to this problem is to use a column oriented flexbox
wrapper around the content that grows to fill the height. This isn't working for me. In the image below, I'm trying to make the container of the green and pink content fill the remaining height of the parent container with red border.
.container {
width: 600px;
height: calc(100vh - 100px);
border: 1px solid red;
}
.something-before {
background: lightblue;
height: 50px;
margin: 10px 0;
}
.text-wrap {
display: flex;
flex-direction: column;
}
.text-wrap>div {
flex-grow: 1;
}
.text-content {
display: flex;
flex-direction: row;
height: 100%;
}
.text-left {
width: 100px;
background: green;
height: 100%;
}
.text-right {
background: pink;
flex-grow: 1;
height: 100%;
}
<div class="container">
<div class="something-before"></div>
<div class="text-wrap">
<div>
<div class="text-content">
<div class="text-left">
Text<br />Text<br />Text<br />
</div>
<div class="text-right">
Text<br />Text<br />Text<br />
</div>
</div>
</div>
</div>
</div>