Skip to content

Instantly share code, notes, and snippets.

@Nikeshsuwal
Created December 24, 2015 11:27
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 Nikeshsuwal/5592ed37c89b01c90678 to your computer and use it in GitHub Desktop.
Save Nikeshsuwal/5592ed37c89b01c90678 to your computer and use it in GitHub Desktop.
How to keep footers at the bottom of the page
<div id="container">
<div id="header"></div>
<div id="body"></div>
<div id="footer"></div>
</div>
html,
body {
margin:0;
padding:0;
height:100%;
}
#container {
min-height:100%;
position:relative;
}
/* IE 6 and IE 5.5*/
#container {
height:100%;
}
#header {
background:#ff0;
padding:10px;
}
#body {
padding:10px;
padding-bottom:60px; /* Height of the footer */
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:60px; /* Height of the footer */
background:#6cf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment