There are 2 div blocks on the page, one after the other, you need to set a general background for these blocks, i.e. one whole picture, tried this way

.welcome, .welcome__progress { background-image: url('../img/bg1.jpg'); background-repeat: no-repeat; background-size: 100%; background-position: center; } 

But on the 2nd block the same picture is duplicated, and does not continue the one that is on the 1st block.

    1 answer 1

     .block { border:1px solid black; width: 200px; height: 300px; display:inline-block; margin:10px; } .welcome, .welcome__progress { background-image: url('https://picsum.photos/458/354?gravity=east'); background-repeat: no-repeat; background-size: 100%; background-position: center; background-attachment: fixed; /* !!! */ } 
     <div class="block welcome"></div> <div class="block welcome__progress"></div> 

    add 1 more background, but only on the first block, on top of another

     .block { border:1px solid black; width: 200px; height: 300px; display:inline-block; margin:10px; } .block div { width: 100%; height: 100%; background-image: url('https://www.gstatic.com/webp/gallery3/1.sm.png'); opacity:0.5; } .welcome, .welcome__progress { background-image: url('https://picsum.photos/458/354?gravity=east'); background-repeat: no-repeat; background-size: 100%; background-position: center; background-attachment: fixed; /* !!! */ } 
     <div class="block welcome"><div></div></div> <div class="block welcome__progress"></div> 

    • perfect! Thank! And one more question, you can somehow add another 1 background, but only on the first block, on top of another - Ayurpwnz
    • one
      @Ayurpwnz It is possible, but for this in the first block one more element is needed - see the second example. - Igor
    • I will understand, thanks. - Ayurpwnz
    • It doesn’t work out a bit, it’s clear that the background is being added, because the text is moving out, but it is in the background, it’s impossible to move it to the front one - Ayurpwnz
    • @Ayurpwnz I find it hard to understand what is happening. Ask another question with an example. - Igor