0

I apologize in advance for my English, I'm using Parallax.js on my page and I ran into the following problem. The picture that I use to create the parallax has a resolution of 3160x2840 but my screen is 1920x1080. Is it possible to make this photo scale to the screen resolution?

Ondiek Elijah
  • 547
  • 8
  • 15
idk
  • 1
  • 1

1 Answers1

0

here is a trick, specify class="parallax-image" to your img tag

.parallax-image {
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

other way you can use

width: 100vw
Nabeel Sajid
  • 193
  • 6