我发现下面的CSS在桌面环境中按预期工作,但在iOS移动环境中,图像不会在后台加载。
我听说修复在iOS环境中可能无法使用,但我还测试了滚动 - 以及多种图像尺寸。
提前致谢
.intro {
display: table;
width: 100%;
height: 100%;
padding: 100px 0;
text-align: center;
background-color: #fff;
background: url(http://ak-hdl.buzzfed.com/static/enhanced/web03/2011/11/11/16/enhanced-buzz-22138-1321048705-11.jpg);
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
答案 0 :(得分:1)
有几个问题:
工作代码:
.intro {
display: table;
width: 100%;
height: 100%;
padding: 100px 0;
text-align: center;
background-color: #fff;
background-image: url(http://ak-hdl.buzzfed.com/static/enhanced/web03/2011/11/11/16/enhanced-buzz-22138-1321048705-11.jpg);
background-position: center;
background-attachment: scroll;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}