Is there a way to add a blur effect to my background when a user clicks a specific button? I want to update my CSS class accordingly.
Below is the current CSS class:
.post_options {
width: 100%;
height: 100%;
float: left;
background-color: #eceff1;
position: fixed;
}
I would like to modify it to apply a blur effect when the user clicks the button:
.post_options {
width: 100%;
height: 100%;
float: left;
background-color: #eceff1;
position: fixed;
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);
}
Here is the button that should trigger the background blur:
<button className="preview_btn" href="#postpreview" onClick={this.preview}>Preview</button>
Note: This implementation is in React.
When trying to create a separate div with background effects, the contents inside also get blurred. How can this be addressed?