Skip to content

Instantly share code, notes, and snippets.

@feo52
Created October 11, 2014 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feo52/14cf0a21fd423ee10b0b to your computer and use it in GitHub Desktop.
Save feo52/14cf0a21fd423ee10b0b to your computer and use it in GitHub Desktop.
sticky footer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body{ margin:0; padding:0; }
html, body { height: 100%; }
.contentsItem{ background:LightPink; height:400px; }
.stickyFooter{ background:LimeGreen; height: 2em; }
.above-Footer{
min-height: 100%;
margin-bottom: -2em;
}
.above-Footer:after {
content: "";
display: block;
height: 2em;
}
</style>
</head>
<body>
<div class="above-Footer">
<div class="contentsItem">
change window-size.<br />
change scrollbar-position.<br />
</div>
</div>
<div class="stickyFooter">sticky footer</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment