Skip to content

Instantly share code, notes, and snippets.

@snarf1974
Created April 22, 2014 23:35
Show Gist options
  • Save snarf1974/11197998 to your computer and use it in GitHub Desktop.
Save snarf1974/11197998 to your computer and use it in GitHub Desktop.
CSS: Sticky footer 1
.container {
margin-bottom: -142px;
min-height: 100%;
/* equal to footer height */
}
.container:after {
content: "";
display: block;
}
.site-footer, .container:after {
height: 142px;
}
.site-footer {
background: #385978;
border-top: 1px solid #000;
color: white;
height: 141px; /*========== Height and border-top added together = 142px used in .container and .site-footer ==========*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment