Last active
December 31, 2015 11:19
-
-
Save FaizVisram/7978812 to your computer and use it in GitHub Desktop.
Make an indeterminately-sized footer float to the bottom of pages where the content doesn't fill the window, and make it stay at the end of a page that does.
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> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<footer class="preload"> | |
<!-- footer content here --> | |
<script src="floating_footer.js" type="text/javascript"></script> | |
</footer> | |
</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
footer.fixed { | |
position: absolute; | |
bottom: 0; | |
} | |
footer.preload { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment