Skip to content

Instantly share code, notes, and snippets.

@webag
Created March 15, 2019 07:35
Show Gist options
  • Save webag/88ea5805f97678a8c0b730d47708b58f to your computer and use it in GitHub Desktop.
Save webag/88ea5805f97678a8c0b730d47708b58f to your computer and use it in GitHub Desktop.
100vh height 100%
<script>
function setIntroHeight(){
var vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
}
setIntroHeight();
</script>
<style>
.block{
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment