Skip to content

Instantly share code, notes, and snippets.

@jackielii
Created December 22, 2015 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackielii/c7f21a48a16fd004f1b9 to your computer and use it in GitHub Desktop.
Save jackielii/c7f21a48a16fd004f1b9 to your computer and use it in GitHub Desktop.
Appbar without fixed positioning
<!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