M
M
muav2018-07-27 11:05:18
Layout
muav, 2018-07-27 11:05:18

Why does the image stop displaying when adding the fixed background property?

I use two absolutely identical blocks on the page with a large picture, which should remain in place while scrolling

<section id="big-big-img-1" class="pt-0 pb-0 dark text-center hidden-sm hidden-xs" style="    background: url('http://matrix-uav.ua/wp-content/uploads/2018/07/DSC0695822-e1532337731108-1.jpg') no-repeat center center;
    
    background-attachment: fixed;																		 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    height: 800px;
">
  
</section>

But in the first block, instead of an image, there is an empty space:
5b5ad1d2c2244613046523.png
(if you remove the background-attachment: fixed; property, then the image appears), and in the second block, everything is always ok:
5b5ad1dee2451521148733.png
What's the magic?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
muav, 2018-07-27
@muav

Found a description of a similar problem. Along the way, all because of the video
https://stackoverflow.com/questions/202409/chrome-issue-with-backg... And I found a solution
in another thread on the toaster :

-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;

Just add to the desired block

R
Rasul Gitinov, 2018-07-27
@raselgit

Try writing "background-image" instead of "background". Repeat and Position are also separate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question