Reputation: 1
I'm trying to set a background image or background color but it does not appear Background image - There is an error on the url Background color - no error appears but no background appears either ...
scss:
:host{
ion-content.bg-image{
background: url('assets/homebackround.jpg') no-repeat 100% 100%;
}
}
html:
<ion-header>
<ion-toolbar>
<ion-title>
ionic4
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="bg-image" no-scroll padding>
</ion-content>
Upvotes: 0
Views: 289
Reputation: 6548
You can directly use the css property given by Ionic4 and here is how you can use it.
ion-content{
--background: url('assets/homebackround.jpg') no-repeat 100% 100%;
}
Here is running code in stackblitz
Upvotes: 1