Created
April 9, 2012 22:22
-
-
Save stanosmith/2347043 to your computer and use it in GitHub Desktop.
CSS: Sticky Footer
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
html, body { | |
height: 100%; | |
} | |
#container { | |
min-height: 100%; | |
} | |
#main { | |
overflow: auto; | |
padding-bottom: 150px; /* must be same height as the footer */ | |
} | |
#footer { | |
position: relative; | |
margin-top: -150px; /* negative value of footer height */ | |
height: 150px; | |
clear: both; | |
} | |
/*Opera Fix*/ | |
body:before { | |
content: ""; | |
height: 100%; | |
float: left; | |
width: 0; | |
margin-top: -32767px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment