Created
October 7, 2014 15:20
-
-
Save feo52/c1f518cd074c97b71d85 to your computer and use it in GitHub Desktop.
sticky footer with calc(vh)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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