Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Forked from galengidman/index.html
Last active August 29, 2015 14:17
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 julianxhokaxhiu/04e7c61c404b36d28961 to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/04e7c61c404b36d28961 to your computer and use it in GitHub Desktop.
`display: table` sticky footer trick
<header class="page-row">
<h1>Site Title</h1>
</header>
<main class="page-row page-row-expanded">
<p>Page content goes here.</p>
</main>
<footer class="page-row">
<p>Copyright, blah blah blah.</p>
</footer>
html,
body { height: 100%; }
body {
display: table;
width: 100%;
}
.page-row {
display: table-row;
height: 1px;
}
.page-row-expanded { height: 100%; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment