Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I heard somewhere that the speed of the parallax can be changed (like more the value of speed in integer, lesser the actual difference between the speeds of the child and background elements, and a really high value is almost equal to no parallax).
How can one change the parallax speed of an element by changing it’s CSS?
This was very helpful in getting a solution up and running in Chrome. Unfortunately, it does not work as is in other browsers. For Firefox, you need to add transform-style: preserve3d to the scrolling container and transform-style: inherit to all elements between the container and the parallax element. But this means you can’t use a pseudo element (:after) because pseudo elements don’t inherit transform properties from their parents. So I ended up creating a separate div inside the section for the background-image and setting z-index to a positive value because Safari doesn’t understand negative z-index. There are also some issues with Internet Explorer, and I’m still working on those…
It’s great to have a CSS-only solution for parallax and I’m pretty set on getting that to work now, but everyone should be forewarned about using the above code and expecting it to work out of the box.
This comment has been deleted
Minimal update to optimize rendering of background images
.bg1::after {
background: url('https://placekitten.com/g/900/700') no-repeat center / cover;
}
.bg2::after {
background: url('https://placekitten.com/g/900/600') no-repeat center / cover;
}
This doesn’t seem to be working on either Chrome (96.0.4664.110) or Firefox (95.0.2). I’ve also cloned the repo to see if I goofed but still no work.
Thank you so much to write this article.
It’d not worked for me as well. However, I added “background-attachment: fixed” in .parallax::after. Then It worked!
There is a .wrapper class missed. Add class=“wrapper” to the tag main and it will work ;)