I have a <div>
with an background-image with blur effect.
-webkit-filter: blur(3px); -moz-filter: blur(3px); -o-filter: blur(3px); -ms-filter: blur(3px); filter: blur(3px);
The only problem is that all the Child elements also get the blur effect. Is it possible to get rid of the blur effect on all the child elements??
<div class="content"> <div class="opacity"> <div class="image"> <img src="images/zwemmen.png" alt="" /> </div> <div class="info"> a div wih all sort of information </div> </div> </div> .content{ float: left; width: 100%; background-image: url('images/zwemmen.png'); height: 501px; -webkit-filter: blur(3px); -moz-filter: blur(3px); -o-filter: blur(3px); -ms-filter: blur(3px); filter: blur(3px); } .opacity{ background-color: rgba(5,98,127,0.9); height:100%; overflow:hidden; } .info{ float: left; margin: 100px 0px 0px 30px; width: 410px; }
http://jsfiddle.net/6V3ZW/
Set position:relative on the parent div and set position:absolute; top:0px; right:0px; bottom:0px; left:0px; (or set height/width to 100%) to the child element for the background. Using this method, the content div will not be affected by properties on the background.
backdrop-filter: blur(10px); It will blur area behind the element.
Create a div inside content & give bg image & blur effect to it. & give it z-index less the the opacity div, something like this.
<div class="content"> <div class="overlay"></div> <div class="opacity"> <div class="image"> <img src="images/zwemmen.png" alt="" /> </div> <div class="info"> a div wih all sort of information </div> </div> </div>
Use Css
.content{ float: left; width: 100%; } .content .overlay{ background-image: url('images/zwemmen.png'); height: 501px; -webkit-filter: blur(3px); -moz-filter: blur(3px); -o-filter: blur(3px); -ms-filter: blur(3px); filter: blur(3px); z-index:0; } .opacity{ background-color: rgba(5,98,127,0.9); height:100%; overflow:hidden; position:relative; z-index:10; }
Add an overlay something like this:
<div class="overlay"></div>
Then:
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; backdrop-filter: blur(2px) sepia(50%); z-index: 9999999999999999999; }
Here the parent child relationship is not what matters. The z-index is important.
It will apply the filter to anything sitting behind the div.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With