title: Blur background behind spinner Angular
body: <p>I am using a spinner in my Angular code while loading any data. I have created a separate component for it(necessary files given below). My spinner looks something like this :</p>
  
  <p><a href="https://i.stack.imgur.com/B8rmk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B8rmk.png" alt="enter image description here"></a></p>
  
  <p>Now, I need to accomplish blurring of the background behind the spinner while showing the loading icon over it. Any idea how to accomplish it?</p>
  
  <p><strong>spinner.component.ts:</strong></p>
  
  <pre><code>import { Component } from "@angular/core";
  
  @Component({
      selector: "loading-spinner",
      templateUrl: "./spinner.component.html",
      styleUrls: ["./spinner.component.css"]
  })
  export class SpinnerComponent{
  
  }
  </code></pre>
  
  <p><strong>spinner.component.html:</strong></p>
  
  <pre><code>&lt;div class="spinner"&gt;
      &lt;div class="rect1"&gt;&lt;/div&gt;
      &lt;div class="rect2"&gt;&lt;/div&gt;
      &lt;div class="rect3"&gt;&lt;/div&gt;
      &lt;div class="rect4"&gt;&lt;/div&gt;
      &lt;div class="rect5"&gt;&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>spinner.component.css:</strong></p>
  
  <pre><code>.spinner {   
      width: 50px;
      height: 40px;
      text-align: center;
      font-size: 10px;
      position: fixed;
      z-index: 1500;
      overflow: show;
      margin: auto;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
    }
  
    .spinner &gt; div {
      background-color: #333;
      height: 100%;
      width: 6px;
      display: inline-block;
  
      -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
      animation: sk-stretchdelay 1.2s infinite ease-in-out;
    }
  
    .spinner .rect2 {
      -webkit-animation-delay: -1.1s;
      animation-delay: -1.1s;
    }
  
    .spinner .rect3 {
      -webkit-animation-delay: -1.0s;
      animation-delay: -1.0s;
    }
  
    .spinner .rect4 {
      -webkit-animation-delay: -0.9s;
      animation-delay: -0.9s;
    }
  
    .spinner .rect5 {
      -webkit-animation-delay: -0.8s;
      animation-delay: -0.8s;
    }
  
    @-webkit-keyframes sk-stretchdelay {
      0%, 40%, 100% { -webkit-transform: scaleY(0.4) }  
      20% { -webkit-transform: scaleY(1.0) }
    }
  
    @keyframes sk-stretchdelay {
      0%, 40%, 100% { 
        transform: scaleY(0.4);
        -webkit-transform: scaleY(0.4);
      }  20% { 
        transform: scaleY(1.0);
        -webkit-transform: scaleY(1.0);
      }
    }
  </code></pre>