JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parallax">
<div class="back"></div>
<div class="front">Page content.<br>Page content.<br>Page content.<br>Page content.<br><footer>In Chrome, this is the end of the page.</footer></div>
</div>
CSS
.parallax {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
perspective: 1px;
position: absolute;
left: 0;
right: 0;
}
.back {
background-image: url(http://goo.gl/DbUUff);
background-size: cover;
margin-bottom: -70em; /* This and a hidden overflow are essential. */
overflow: hidden;
position: absolute;
height: 70em; /* Set to a large value to work on different page lengths. */
left: 0;
right: 0;
transform: translateZ(-2px) scale(3);
}
.front {
transform: translateZ(0);
}
/* Other Detais not Related to Parallax */
.front {
color: white;
font-size: 30px;
line-height: 300px;
text-align: center;
text-shadow: 0 0 5px black;
}
footer {
line-height: 40px;
margin-bottom: 50px;
}