Skip to content

Instantly share code, notes, and snippets.

@FaizVisram
Last active December 31, 2015 11:19
Show Gist options
  • Save FaizVisram/7978812 to your computer and use it in GitHub Desktop.
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.
<!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>
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