Created
January 17, 2014 19:02
-
-
Save jonathanpglick/8479389 to your computer and use it in GitHub Desktop.
Vertical fill remaining area with flexbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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%; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="top"> | |
<h1>Title</h1> | |
</div> | |
<div class="content"> | |
<div class="inner"> | |
content | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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