How to get a parallax scroll effect with images?

.wrapper {
  height: 100vh;
}

.parallax-img {
  background-image: url('https://placehold.it/1220x1060');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  height: 100%;
}
<div class="wrapper">
  <div class="parallax-img"></div>
  <p>
    /* fill with a looot of text */
  </p>
</div>

<div class="wrapper">
</div>
Copy

September 4th, 2019

# Parallax images on scroll with CSS

Add to bookmarks

A simple css only way to get a parallax effect for images.

Tracking with Matomo to improve the UX. See Privacy Policy for more details.