-1
I have a section
, occupies the entire area of the browser window, and with a background image filling its entire area. Within this section
have a div
centered and with another background image.
I’d like to apply an effect blur
in section
in order to blur the background image, however, I would like the div
within the section
not affected by the effect. The problem is that when applying the blur
in section
, to div
within it is also affected. How could apply the blur
in Ction without affecting the div
?
Code:
body{
margin: 0;
padding: 0;
}
section{
position: relative;
display: flex;
justify-content: center;
align-items: center;
background: url(https://images2.alphacoders.com/728/728536.jpg);
background-attachment: fixed;
height: 100vh;
filter: blur(5px);
}
#meio{
filter: blur(0);
background-image: url(https://wallpaperstudio10.com/static/wpdb/wallpapers/1920x1080/195173.jpg);
background-size: cover;
width: 600px;
height: 600px;
border-style: solid;
border-color: blue;
border-width: 20px;
box-shadow: 10px 5px 5px red;
}
<section>
<div id="meio"></div>
</section>
When adding a question, specify your question, don’t just post the code... so it wouldn’t work. There are two solutions: The first (which I believe is the easiest) is to edit the image in some editor and then use the image The second is to put the div out of the Section and use the Absolute position to overwrite the image below. (#middle {position: Absolute; margin: 5%0 0 30%;}
– Vinicius Gabriel