console
<div class="container">
<div class="box1">box1</div>
<div class="box2">box2</div>
<div class="box3">box3</div>
</div>
*{
box-sizing: border-box;
}
body{
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
margin: 0;
padding: 0;
}
.container{
height: 500px;
position: relative;
transform-style: preserve-3d;
perspective-origin: center center;
perspective: 2px;
}
.box1{
background-color: lightblue;
width: 100px;
text-align: center;
position: absolute;
top: 40%;
left: 0;
}
.box2{
background-color: lightcoral;
width: 100px;
text-align: center;
transform: translateZ(-2px);
position: absolute;
top: 40%;
left: 100px;
}
.box3{
background-color: lightgreen;
width: 100px;
text-align: center;
transform: translateZ(-3px);
position: absolute;
top: 20%;
left: 220px;
}