K
K
Kee_real2019-06-24 04:20:36
css
Kee_real, 2019-06-24 04:20:36

Why is the background image shifting instead of being cut off?

5d10254f945df704840347.jpeg
There is this page, it has two sections, both sections have backgrounds made with a picture. Moreover, the background of the first section has the upper part of the green triangle from below, and the second one has the lower part of this triangle - i.e. a background triangle is formed. Both images are 1920px wide (css parameters for each background section: url('image path')no-repeat center top /cover).
5d10256067da0117884858.jpeg
But as soon as the screen is reduced a little, the background of the second section starts to move out, thus the common triangle turns out to be crooked, although, according to the idea, when the screen is reduced, the backgrounds should be cut off and not shifted, because both sections have the cover parameter in the background properties. Help solve this problem!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Napechkin, 2019-06-24
@mypage93

background-size:100% 100%;
background-repeat:no-repeat;
background-position:....
You can experiment with these options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question