Skip to content

Instantly share code, notes, and snippets.

@jquerygeek
Created November 24, 2014 09:37
Show Gist options
  • Save jquerygeek/20dd5a288e8db0ef6ac2 to your computer and use it in GitHub Desktop.
Save jquerygeek/20dd5a288e8db0ef6ac2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class='example'>
<div id='wrapper'>
<header>
<h1>Sticky Footer Example</h1>
</header>
<p>
This is the main content area.
</p>
<p>
In this example you should pretend that the red box
is actually the browser window.
</p>
<p>
Because, being a contrived example, it's not actually sticking
to the bottom of the page.
</p>
<div id='footer_push'></div>
</div>
<footer>
This is the footer area.
</footer>
</div>
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
@import "compass/layout/sticky-footer";
@include sticky-footer(50px, "#wrapper", "#footer_push", "footer");
header {
background: #999999;
height: 72px;
}
footer {
background: #cccccc;
}
.example {
height: 700px;
p {
margin: 1em 0.5em;
}
}
html, body {
height: 100%;
}
#wrapper {
clear: both;
min-height: 100%;
height: auto !important;
height: 100%;
margin-bottom: -50px;
}
#wrapper #footer_push {
height: 50px;
}
footer {
clear: both;
position: relative;
height: 50px;
}
header {
background: #999999;
height: 72px;
}
footer {
background: #cccccc;
}
.example {
height: 700px;
}
.example p {
margin: 1em 0.5em;
}
<div class='example'>
<div id='wrapper'>
<header>
<h1>Sticky Footer Example</h1>
</header>
<p>
This is the main content area.
</p>
<p>
In this example you should pretend that the red box
is actually the browser window.
</p>
<p>
Because, being a contrived example, it's not actually sticking
to the bottom of the page.
</p>
<div id='footer_push'></div>
</div>
<footer>
This is the footer area.
</footer>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment