在Android上重复背景

时间:2013-06-18 05:08:41

标签: android css

我有一个我创建的移动响应主题,并且效果很好..除了android之外的一切。后台图像加载并且看起来很好,但是在加载页面时,它不会在站点中不在视图中的部分上呈现。每次向下滚动页面时,背景都是白色的。我现在的代码是:

body
{

 background: url('images/MobileBack.png') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

我已尝试过此声明的其他变体,但无济于事。有没有办法只使用CSS在Android上加载背景,还是我需要深入研究? (PS。它在iPhone和iPad上运行良好)。

2 个答案:

答案 0 :(得分:1)

好的,问题是center center fixed声明的background附件。

答案 1 :(得分:0)

您需要使用媒体查询来解决此问题

@media screen {
background: url('images/MobileBack.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

希望如果没有,那么如果你不介意让我看到它的屏幕截图