我有一张 1920x1080 的大背景图片。我想在我的登陆页面上使用它作为完整的背景图片。我在我的电脑上用 chrome、firefox、opera 试过了,它运行良好,甚至在我的 iPad 上用 chrome。但不是在我的应用程序 Chrome 应用程序中的 android 手机上,图像在那里但它没有填满整个页面,它只是在屏幕中间结束(纵向模式)。我想用这张图片填充整个页面背景。
body{
background-image: url(bg_2.jpg);
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
}
最佳答案
我将其用于我的移动应用:
<meta name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
和CSS:
body {
background: transparent url(../icons/texture.png) no-repeat center center;
background-size: cover;
}
最好的
中号
关于javascript - css 背景图像在 android 上显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24215468/