网站背景图片显示在所有其他设备上,例如笔记本电脑和android手机。但是不仅限于ios mobile。我什至将图片的尺寸调整为768 px * 365 px,但无法正常工作。
.bg-img {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: -1;
background-position: center;
background-size: cover;
background-attachment: fixed;
}
.bg-img .overlay {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
opacity: .8;
background: #1C1D21;
}
<!-- Background Image -->
<!-- large device only -->
<div class="visible-xl visible-lg visible-md hidden-sm hidden-xs">
<div class="bg-img" style="background-image: url('./img/team/background-clouds-dark-957002.jpg');">
<div class="overlay"></div>
</div>
</div>
<!-- mobile only -->
<div class="visible-xs visible-sm hidden-md hidden-lg hidden-xl">
<div class="bg-img" style="background-image: url('./img/team/Smallsize.jpg');">
<div class="overlay"></div>
</div>
</div>
<!-- /Background Image -->
答案 0 :(得分:0)
css取决于浏览器而不是os 请安装chrome进行测试。或将CSS用于单独的浏览器
#urID{
background:url("../images/bg.jpg") no-repeat scroll right top #000000;
-o-background-size: cover;
-moz-background-size: cover;
-webkit-background-size:cover;
background-size: cover;
}