Background image not shown in android phonegap app

25 views
Skip to first unread message

hub ino

unread,
May 12, 2015, 10:35:08 AM5/12/15
to phon...@googlegroups.com

I'm trying to show a background image on an Android phonegap app using css. This is the sample 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>

while using this code the background image is not shown in certain android phones such as sony ericsion but in most of the android phones and also in iPhone this code is working fine.

So I tried to change style as shown below

<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>

After this style applied the app launched as below in the image 


Gianluca Moro

unread,
May 12, 2015, 1:50:42 PM5/12/15
to phon...@googlegroups.com
hi,

try to put as image path

../www/img/imagename.PNG

bye
giammy

Jesse Monroy

unread,
May 12, 2015, 6:07:24 PM5/12/15
to phon...@googlegroups.com
It appears you have a typo:
url("img/bg_index.jpg";)
should be
url("img/bg_index.jpg")

You have an extra semicolon.

Jesse
Reply all
Reply to author
Forward
0 new messages