Skip to content

Instantly share code, notes, and snippets.

@lelandsmith
Created March 13, 2014 22:34
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 lelandsmith/9538544 to your computer and use it in GitHub Desktop.
Save lelandsmith/9538544 to your computer and use it in GitHub Desktop.
HTML: Keep Footer on Bottom
<div id="wrap">
<div id="main" class="container clear-top">
<p>Your content here</p>
</div>
</div>
<footer class="footer"></footer>
<style>
html, body {
height: 100%;
}
#wrap {
min-height: 100%;
}
#main {
overflow:auto;
padding-bottom:150px; /* this needs to be bigger than footer height*/
}
.footer {
position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear:both;
padding-top:20px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment