You should be able to make use of the flex-grow
property:
HTML
<div class="wrapper">
<div class="header"></div>
<div class="content">
<div class="element-child1"></div>
<div class="element-child2"></div>
<div/>
</div>
Css
html, body, .wrapper {
width: 100%;
height: 100%;
margin: 0;
}
.wrapper {
display: flex;
flex-direction: column;
}
.wrapper > .header {
flex: 0 0 40px;
background-color: black;
}
.wrapper > .content {
flex-grow: 1;
display: flex;
background: red;
flex-direction: column;
}
.element-child1 {
flex: 0 0 20px;
background-color: blue;
}
.element-child2 {
flex-grow: 1;
background-color: green;
}
Alternatives