Skip to content

Instantly share code, notes, and snippets.

@jonathanpglick
Created January 17, 2014 19:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanpglick/8479389 to your computer and use it in GitHub Desktop.
Save jonathanpglick/8479389 to your computer and use it in GitHub Desktop.
Vertical fill remaining area with flexbox.
/**
* Vertical fill remaining area with flexbox.
*/
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
display: -webkit-flex;
display: flex;
flex-direction: column;
}
.top {
overlay: hidden;
background: blue;
}
.content {
background: red;
flex: 1;
position: relative;
}
.inner {
background: gray;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
}
<div class="top">
<h1>Title</h1>
</div>
<div class="content">
<div class="inner">
content
</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment