I would like to have 3 elements (a header, a footer, and some content) stacked vertically in the page. The header and footer div have a fixed height. How can I make the content div (the one in the middle) take up the remaining vertical space?
My attempt with Flexbox
.wrapper {
display: flex;
flex-direction: column;
width: 100%;
}
.header {
background-color: red;
height: 100px;
}
.content {
background-color: blue;
flex: 1;
}
.footer {
background-color: green;
height: 30px;
}
<div class="wrapper">
<div class="header" />
<div class="content" />
<div class="footer" />
</div>