KamalSalem
KamalSalem

Reputation: 495

Phonegap background image for iOS not working

I'm working with Phonegap to develop an application for the iPhone.

I have the application design from our designer, and am trying to set the background for the index.html page. No matter what code I try, I cannot get it to display and I always end up with a white background.

I tried this but didn't work

<body style="background: url(images/bg.jpg) no-repeat;background-size: 100%;" >

I also tried creating a class in the end of the JQuery CSS file, and applying it to the main div or body of the page, that didn't work too

I even tried to override the whole body CSS, that didn't work either

body         {
  background: url(images/bg.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    }

Any Ideas?

Upvotes: 0

Views: 2057

Answers (1)

Jim Thurston
Jim Thurston

Reputation: 11

First make sure the path is correct i.e. images folder is at same path as HTML page, or at CSS level if declared in CSS. If not that try putting images/bg.jpg in single quotes, so:

<body style="background: url('images/bg.jpg') no-repeat;background-size: 100%;" >

Upvotes: 1

Related Questions