这是否适用于 > iOS 5?
.element {
background: url(images/myImage.jpg) 50% 0 no-repeat fixed;
}
我认为它应该,但到目前为止还没有。
最佳答案
您可以使用一个单独的元素和 position: fixed
来解决这个问题!
HTML:
<div id="Background"></div>
<div id="Content"></div>
CSS:
#Background {
background: #000 url("img/Background.jpg") no-repeat 50% 0;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1
}
关于css - 固定的背景附件在 iOS5 中工作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9779195/