Created
December 22, 2015 10:26
-
-
Save jackielii/c7f21a48a16fd004f1b9 to your computer and use it in GitHub Desktop.
Appbar without fixed positioning
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<style type="text/css"> | |
.app { | |
display: flex; | |
flex-direction: column; | |
height: 100vh; | |
/* the height can be anything: e.g. 100% of parent */ | |
} | |
.content { | |
overflow-y: auto; | |
} | |
/* optional: make it look better */ | |
html * { | |
margin: 0; | |
} | |
body *:not(.app) { | |
padding: 1rem; | |
} | |
.appbar { | |
background-color: indigo; | |
color: white; | |
padding: 1rem; | |
} | |
</style> | |
</head> | |
<body> | |
<article class="app"> | |
<header class="appbar">home | about | faq</header> | |
<section class="content"> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
<p>hello</p> | |
<p>world</p> | |
</section> | |
</article> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment