JSFiddle - React, Tailwind, and code Playground
by hollanditkzn
HTML
<div class="parallacs">
<div class="group">
<div class="layer layer-back">
<h1 class="title">This is bacground</h1>
</div>
<div class="layer layer-base">
<h1 class="title">This is base</h1>
</div>
</div>
</div>
CSS
body{
padding: 0;
margin: 0;
font-family: 'Open Sans', Arial;
background-color: bisque;
}
.parralax{
height: 100vh;
perspective: 1px;
overflow-x: auto;
overflow-y: hidden;
}
.layer{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 100vh 0;
}
.layer-base{
transform: translateZ(0px);
}
.layer-back{
transform: translateZ(-1);
}
.title{
text-align: center;
width: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}