【发布时间】:2015-05-12 11:55:12
【问题描述】:
我正在尝试使用 CSS 在 Android phonegap 应用上显示背景图片。这是示例 HTML
<html>
<head>
<title>Login page</title>
</head>
<body style="margin: 0px; background: url("img/bg_index.jpg";) repeat scroll 50% 0px / cover transparent;">
</body>
</html>
使用此代码时,背景图像不会在某些 android 手机(如索尼爱立信)中显示,但在大多数 android 手机和 iphone 中,此代码都可以正常工作。
所以我尝试改变样式如下所示
<html>
<head>
<title>Login page</title>
</head>
<body style="margin: 0px;background: url("img/bg_index.jpg";) repeat scroll 50% 0px / cover transparent; background-image: url("img/bg_index.jpg";);background-repeat:no-repeat;">
</body>
</html>
应用此样式后,应用启动如下图
如何编写一个所有android设备和iphone都接受的背景样式
【问题讨论】:
标签: android html css cordova phonegap-build