Skip to content

Instantly share code, notes, and snippets.

Created July 8, 2014 05:53
Show Gist options
  • Select an option

  • Save anonymous/4020fbdb646465f46e63 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4020fbdb646465f46e63 to your computer and use it in GitHub Desktop.
A Pen by Anonasaurus Rex.
<div class="wrapper">
<header>
<h1>Sticky Footer <span>Just CSS!</span></h1>
</header>
<div class="sticky"></div>
</div>
<footer>
<h1>Footer <span>Resize the window!</span></h1>
</footer>
@import "compass/css3";
@import "compass";
@import url("http://fonts.googleapis.com/css?family=Lato");
$background: #2ecc71;
$checkbox-base-color: #27ae60;
$footer-height: 200px;
* {
margin: 0;
padding: 0;
//text-align: center;
@include box-sizing(border-box);
}
body {
font-family: lato;
color: #fff;
background: $background;
}
h1 {
font-weight: normal;
font-size: 40px;
font-weight: normal;
text-transform: uppercase;
padding: 55px 30px;
span {
font-size: 13px;
display: block;
padding-left: 4px;
}
}
p {
display: block;
float: left;
font-size: 20px;
}
html,
body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto $footer-height * -1;
}
.sticky {
height: $footer-height;
}
footer {
background-color: darken($background, 15%);
height: $footer-height;
h1 {
padding-top: 20px!important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment