Skip to content

Instantly share code, notes, and snippets.

@feo52
Created October 7, 2014 15:20
Show Gist options
  • Save feo52/c1f518cd074c97b71d85 to your computer and use it in GitHub Desktop.
Save feo52/c1f518cd074c97b71d85 to your computer and use it in GitHub Desktop.
sticky footer with calc(vh)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body{ margin:0; padding:0; }
.contentsItem{ background:LightPink; height:400px; }
.stickyFooter{ background:LimeGreen; height: 2em; }
.above-Footer{
min-height: calc(100vh - 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