JSFiddle - React, Tailwind, and code Playground
HTML
<div class="layer1 paralax">
<div>
</div>
</div>
<div class="layer2 paralax">
<div>
</div>
</div>
CSS
body,html{
width: 100%;
height: 100%;
}
.paralax>div{
height: 3000px;
}
.layer1,.layer2,.layer3{
background: rgba(0,0,0,0.2);
position: fixed;
top: 0px;
left: 0px;
width: 100%;
overflow: hidden;
height: 100%;
}
.layer1{
z-index: 1;
}
.layer2{
z-index: 2;
}
.quadra{
width: 50px;
height: 50px;
position: absolute;
background: black;
}
.circle{
width: 50px;
height: 50px;
position: absolute;
background: red;
border-radius: 50px;
}