javascriptangulargoogle-chromesassinspector

How to load an background image in the assets folder in scss, using angular


I'm trying to do this on angular, on styles.scss

.main-content {
    height: 80vh;
    padding: 30px;
    background-image: '/assets/adult-g3180e6c1c_1920.jpg';
}

But Google Inspector says this: Google Inspector comment

Help please!!!


Solution

  • Try

    .main-content {
      height: 80vh;
      padding: 30px;
      background-image: url('assets/adult-g3180e6c1c_1920.jpg'); 
     }