简体   繁体   中英

How to make blur the whole page except the div content in the middle using angular js?

I want something like the attached image. I am able to do the same look except blurring the background. I tried making it using angularjs. I am unable to blur. How can I make it as the below image. I have used the below angular code to make the page blur. I have searched and I have got blurring a page except a form. But in this case it is not a form. I want to blur the page except div content.

在此处输入图片说明

<!DOCTYPE html>
    <html lang="en">
    <head>
      <title>Bootstrap Example</title>
      <meta charset="utf-8">

      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>

    <div>
        <div class="container">
            <center>
            <h3 class="container">Select a type</h3>
            <div>This is to test the page:
                <div class = "btn-group pull-center">
                  <button type = "button" class = "btn dropdown-toggle" data-toggle = "dropdown">Dropdown 
                   <span class = "caret"></span>
                  </button>

                    <ul class = "dropdown-menu" role = "menu">
                     <li>Action</li>
                     <li>Another action</li>
                     <li>Something else here</li>
                    </ul>
                </div>
            </div>
        </center>
        </div><br/><br/>

        <div class="container" style="margin-left:15cm">
            <div class="row">
             <div class="col-md-6">
              <p class="col-md-6"><b>Your paragraph goes here</b><br/>This is to test the page</p>
             </div>

             <div class="col-md-4">
               <div class="row">
                 <div class="btn btn-primary col-md-6">button 1</div><br/><br/>
               </div>

               <div class="row">
                 <div class="btn btn-success col-md-6">button 2</div><br/><br/>
               </div>

                  <div class="row">
                    <div class="btn btn-warning col-md-6">button 3</div> <br/><br/>
                  </div>

                </div>

              </div>
              <hr style="margin-right:9cm"></hr>
            </div>

            <div class="container" style="margin-left:15cm">
              <div class="row">

                <div class="col-md-6">
                  <p class="col-md-6"><b>Your paragraph goes here</b><br/>empty space between </p>
                </div>

                <div class="col-md-4">

                  <div class="row">
                    <div class="btn btn-danger col-md-6">Button 4</div><br/><br/>
                  </div>

                </div>

              </div>
            </div>
    </div>
    </body>
    </html>

Create three containers, one for your content that doesn't exist on the form, one for the blur and one for the form content.

<div class="normal-content">
    <p>Content that is on your page</div>
<div class="blur"></div>
<div class="form-content">
    <p>Content that would exist on the form</p>
</div>

CSS

.blur{
    position:absolute;
    // We'll grow the blur box to be bigger than 100% so there isn't some weird effects that you can get with blur
    width: 104%;
    height: 104%;
    top: -2%;
    left: -2%;
    filter: blur(5px);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM