Ionic4 - Setting background-image not showing


Hello there,

I am trying to change the background image of ion-content page but cannot.

I am using ionic4 version4.10.3

i have tried in the page scss:

ion-content {
    --background: url('/assets/img/background.jpg') no-repeat center center fixed;


ion-content {
	background-image: url('/assets/img/image.png') !important;

both have not worked.
The page still loads with a white background

Any help will appreciated!.



Note , the path to the asset is relative to the page’s directory.

ion-content {
  --background: url(../../assets/bg.jpg) no-repeat center/cover fixed;

Works like a charm !

Thank You!