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?

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

2 Comments

it doesn't change anything, it looks like it's being ignored
you can use width: 100vw height: 100vw but it is not recommended

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.