【发布时间】:2014-09-02 13:35:46
【问题描述】:
我的网站无法在移动设备上正常显示
这是我在 CSS 中使用的代码,这也是我希望它在移动设备上执行的操作:
html {
background-image: url(/wp-content/themes/Newstyle/images/bg.jpg), url(/wp-content/themes/Newstyle/images/bg-repeat.jpg);
background-attachment: scroll, scroll;
background-color: #000;
background-repeat: no-repeat, repeat-y;
background-position: center top, center top;
}
html, body {
width:100%;
height:100%;
}
我不知道我做错了什么,我尝试了一些修复方法,但我无法使其正常工作。有人可以帮忙吗?链接如下。
【问题讨论】:
-
你能试试
background-size: 100%吗? -
您可能遇到了与this question 中的用户相同的问题。据说,iOS 浏览器不支持将
body标记的背景图像居中……这可能也适用于 Android。建议的解决方法是使用包装器并将图像应用于该包装器。我现在不需要工具来测试它。 -
@khakiout 加了,恐怕没用。
-
@WoodrowBarlow 这是我尝试过的,我包含了背景包装,但遗憾的是它没有效果。并且在添加“背景位置-x:50%;”时它切断了图像的一半。