背景附件:固定不工作在android / ios

问题描述:

这是我的代码:

<div style="width: 100vw; height: 100vh; background-image: url(img/kid1/1.jpg); background-attachment: fixed; background-size: cover"></div>
<div style="width: 100vw; height: 100vh; background-image: url(img/kid1/2.jpg); background-attachment: fixed; background-size: cover"></div>

它适用于我的LAPTOP上的chrome,但没有应用程序chrome或任何网络浏览器在android / ios (智能设备)。事情是我试过这个代码在w3c练习mod和它的确在我的手机上工作,所以我的代码没有错,我的手机没有错,所以这里的问题是什么?我该如何解决这个问题?我是新手,所以这可能是一个noob问题,但这个错误真的很烦我...

It works fine with chrome on my LAPTOP but not with app chrome or any web browser on android/ios(smart device). The thing is I did try this code on w3c practice mod and it did work on my phone so my code is not wrong, my phone is not wrong so what is the problem here? And how can I fix this? I'm newbie so this might be a noob question but this error really pisses me off...

固定;

 .fixed { 
    background: url(img/kid1/1.jpg) no-repeat center center;
    background-attachment:fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    }