Skip to content

Instantly share code, notes, and snippets.

@ClementParis016
Created March 25, 2015 20:19
Show Gist options
  • Save ClementParis016/cee22927bb34db5ee3f5 to your computer and use it in GitHub Desktop.
Save ClementParis016/cee22927bb34db5ee3f5 to your computer and use it in GitHub Desktop.
Sticky footer
<!doctype html>
<html>
<head></head>
<body>
<header>...</header>
<div>...</div>
<footer>...</footer>
</body>
</html>
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
padding-bottom: 100px; /* footer's height */
}
div::after { /* Or what else is before the footer, clear it */
content: '';
display: table;
clear: both;
}
footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 100px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment