title: How to set background image in div-element in Angular Material app?
body: <p>I know this has been asked, but none of the solutions work. 
  I have following html and I can get the image displayed if I use the commented img-element </p>
  
  <pre><code>&lt;img src="assets/utgmap.jpg"&gt;
  </code></pre>
  
  <p>and comment away the following div-element. However I would like to have background image for the div instead and it's not working. CSS definition is in the end of the file and there's no 404 error for the image so it can be fetched but is is not displayed.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;mat-sidenav-container class="sidenav-container"&gt;
    &lt;mat-sidenav #drawer class="sidenav" fixedInViewport="true"
    [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
    [mode]="(isHandset$ | async) ? 'over' : 'side'"
    [opened]="!(isHandset$ | async)"&gt;
    &lt;mat-toolbar&gt;Menu&lt;/mat-toolbar&gt;
      &lt;mat-nav-list&gt;
        &lt;a mat-list-item href="#"&gt;Link 1&lt;/a&gt;
        &lt;a mat-list-item href="#"&gt;Link 2&lt;/a&gt;
        &lt;a mat-list-item href="#"&gt;Link 3&lt;/a&gt;
      &lt;/mat-nav-list&gt;
  &lt;/mat-sidenav&gt;
  &lt;mat-sidenav-content&gt;
    &lt;mat-toolbar color="primary"&gt;
      &lt;mat-toolbar-row&gt;
        &lt;button mat-icon-button (click)="toggleSidenav.emit()"&gt;
          &lt;mat-icon&gt;menu&lt;/mat-icon&gt;
        &lt;/button&gt;
        &lt;span&gt;webgisproto&lt;/span&gt;
        &lt;button mat-icon-button&gt;
          &lt;mat-icon&gt;settings&lt;/mat-icon&gt;
        &lt;/button&gt;
        &lt;button mat-icon-button&gt;
          &lt;mat-icon&gt;help_outline&lt;/mat-icon&gt;
        &lt;/button&gt;
        &lt;button mat-icon-button [matMenuTriggerFor]="menu"&gt;
          &lt;mat-icon&gt;exit_to_app&lt;/mat-icon&gt;
        &lt;/button&gt;
        &lt;mat-menu #menu="matMenu"&gt;
            &lt;button mat-menu-item (click)="logout()"&gt;
              &lt;mat-icon&gt;exit_to_app&lt;/mat-icon&gt;
              &lt;span&gt;Sign out&lt;/span&gt;
            &lt;/button&gt;
        &lt;/mat-menu&gt;
      &lt;/mat-toolbar-row&gt;
    &lt;/mat-toolbar&gt;
    &lt;app-menu&gt;&lt;/app-menu&gt;
    &lt;!-- THIS WORKS!!
    &lt;img src="assets/utgmap.jpg"&gt;
    IF I UNCOMMENT THIS AND COMMENT OUT THE FOLLOWING DIV --&gt;
    &lt;div class="bgimg"&gt;
      &lt;div class="testclass"&gt; 
          &lt;mat-list color="primary"&gt;
            &lt;mat-list-item&gt; 
                &lt;button mat-icon-button&gt;
                    &lt;mat-icon&gt;settings&lt;/mat-icon&gt;
                  &lt;/button&gt;
            &lt;/mat-list-item&gt;
            &lt;mat-list-item&gt;
                &lt;button mat-icon-button&gt;
                    &lt;mat-icon&gt;help_outline&lt;/mat-icon&gt;
                  &lt;/button&gt;
            &lt;/mat-list-item&gt;
          &lt;/mat-list&gt;
        &lt;/div&gt;
      &lt;/div&gt;
   &lt;/mat-sidenav-content&gt;
  </code></pre>
  
  <p></p>
  
  <p>CSS:</p>
  
  <pre><code>.testclass {
     float: right;
  }
  
  .bgimg {
      background: url('../../assets/utgmap.jpg') no-repeat center center fixed;
   }
  </code></pre>
  
  <p>If I change the path above there will be error.</p>