Skip to content

Instantly share code, notes, and snippets.

@jll90
Created February 3, 2019 19:58
Show Gist options
  • Save jll90/e458ce9b84b428d13817ef73576b875c to your computer and use it in GitHub Desktop.
Save jll90/e458ce9b84b428d13817ef73576b875c to your computer and use it in GitHub Desktop.
Page content flex-grows between top navbar and footer
<html>
<style>
body {
padding: 0;
margin: 0;
box-sizing: border-box;
width: 100%;
background: red;
height: 100vh;
}
.container {
background: blue;
display: flex;
height: inherit;
flex-direction: column;
}
.top {
background: white;
height: 30px;
}
.flex-grow {
flex-grow: 1;
}
.bottom {
height: 30px;
background: yellow;
}
</style>
<body>
<div class="container">
<div class="top">
</div>
<div class="flex-grow">
</div>
<div class="bottom">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment