Vik
Vik

Reputation: 9319

ionic 3 angular background image not appearing

i am having a ionic 3 angular app and using the background as follows:

app.scss

ion-content{
    background-image: url('/assets/images/dummy_bg.jpg');
}

this works fine when i see it in desktop browser. however, it does not render the background image on the iphone when i deploy it.

what could be the issue? i have made sure the size for my iphone 7 plus is 1242*2208

do i need to do something else to get it working?

Upvotes: 1

Views: 1038

Answers (2)

Pradeep Kumar Das
Pradeep Kumar Das

Reputation: 891

You can use below code to execute in server because of path problem :

 background-image: url('assets/images/dummy_bg.jpg'); 
or
 background-image: url('../assets/images/dummy_bg.jpg');

Upvotes: 3

Duannx
Duannx

Reputation: 8746

Just remove the forward slash in the url:

background-image: url('assets/images/dummy_bg.jpg');

Upvotes: 0

Related Questions