JSFiddle - React, Tailwind, and code Playground
by BaliBalo
HTML
<div id="first">Scroll down</div>
<div id="second"></div>
<div id="third">Footer</div>
CSS
html
{
height: 100%;
overflow: hidden;
}
body
{
-webkit-perspective: 1px;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
div
{
box-sizing: border-box;
height: 100%;
box-shadow: 0 -1px 10px rgba(0,0,0,0.7);
position: relative;
-webkit-perspective: 1px;
-webkit-transform-style: preserve-3d;
}
div:before
{
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-position: center;
background-size: cover;
}
#first, #third
{
background: white;
}
#second
{
z-index: -1;
padding: 3em;
}
#second:before
{
background-image: url(http://lorempixel.com/800/600/);
-webkit-transform: translateZ(-1px) scale(3);
}