Unable to set background image in ionic

I am new to ionic framework and trying to add background image to my content but it is not working below is the code I tried the following is my scss file

registration-page{

    ion-content{
    .bg-image  {   
       background-image:url(../img/hulk.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        background-color: #45372E;       
    }
  }
 }

Upvotes: 0

Views: 51

Answers (1)

Amine Mansouri
Amine Mansouri

Reputation: 11

If you want the background to be global, try going to variables.scss and do something like this:

   .ion-page {
      background-image: url('../assets/img/hulk.jpg');
      background-size: cover;
    }

Of course the url depends on where you put the image. If your "img" folder is in "assets" your url should be as shown above.

Upvotes: 1

Related Questions