Created
March 15, 2019 07:35
-
-
Save webag/88ea5805f97678a8c0b730d47708b58f to your computer and use it in GitHub Desktop.
100vh height 100%
This file contains 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
<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