Javascript
<script type="text/javascript">
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
window.addEventListener('resize', () => {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
});
</script>
CSS
selector {
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
}
Just a moment...
コメント