Created
June 3, 2015 13:54
-
-
Save aarongarciah/c450191c913c79178720 to your computer and use it in GitHub Desktop.
Sticky footer html5 (http://ryanfait.com/html5-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> | |
<head> | |
<link rel="stylesheet" href="layout.css" /> | |
</head> | |
<body> | |
<div class="wrapper"> | |
<p>Your website content here.</p> | |
<div class="push"></div> | |
</div> | |
<footer> | |
<p>Copyright (c) 2008</p> | |
</div> | |
</body> | |
</html> |
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
* { | |
margin: 0; | |
} | |
html, body { | |
height: 100%; | |
} | |
.wrapper { | |
min-height: 100%; | |
margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */ | |
} | |
footer, .push { | |
height: 155px; /* '.push' must be the same height as 'footer' */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment