我遇到了一个问题,我的网站上的第一张背景图片显示在台式机上,而不显示在移动设备上(它是灰色背景)。图片为.jpg,大小为4595p x 2736p(546 KB)
有问题的网站:https://www.basit.dev/,如果需要https://github.com/Basit-Sheikh/basit.dev,可以在此处找到完整的代码
有人知道为什么会这样吗?
以下是相关代码:
CSS:
.bg {
background-image: url(../img/s0.jpg);
height: 100%;
background-position: 80% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
HTML
<div id="slides">
<div class="bg"></div>
</div>
答案 0 :(得分:0)
我知道了。您无法在手机上安装固定的背景图片,我通过编写简单的jQuery脚本使用了一种解决方法。