I hope you have a nice day.
Today I came to a strange thing. When I set the body to 100vh, it is supposed to take the height of the viewport, the screen height.
But when I create multiple elements with bigger height than my body and set their background to transparent, I still see my body under them.
body {
margin: 0;
height: 100vh;
width: 100%;
background: #000;
}
.home {
width: 100%;
height: 100%;
background: lightblue;
}
.overflow {
width: 100%;
height: 100%;
background: transparent;
}
<div class="home"></div>
<div class="overflow"></div>
You also have this codepen if you want to visualize it. https://codepen.io/Ziratsu/pen/ExjMpyO
Can someone explain to me why the body is still here while we scroll to another div who is supposed to overflow the body height ?
Thank you so much.