Created
November 30, 2010 18:56
-
-
Save kswedberg/722171 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<title>sticky-footer</title> | |
<style> | |
html { | |
height: 100%; | |
background-color: #dfd; | |
} | |
body { | |
position: relative; | |
min-height: 100%; | |
width: 920px; | |
margin: 0 auto; | |
padding: 0 20px; | |
background-color: #fff; | |
} | |
/* for IE6 */ | |
* html body { height: 100%; } | |
/* body > .footer */ | |
.footer { | |
position: absolute; | |
height: 60px; /* .footer height <= .container padding-bottom*/ | |
margin: 0 auto; | |
padding: 0 20px; | |
bottom: 0; | |
left: 0; | |
width: 920px; | |
background-color: #ff0; | |
overflow: hidden; | |
} | |
.footer p { | |
margin: 0; | |
padding: 1em 0; | |
} | |
/* body > .container*/ | |
.container { | |
margin: 0; | |
padding: 20px 0 80px; | |
} | |
</style> | |
<body> | |
<div class="container"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
</div> | |
<div class="footer"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> | |
</div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment