How is my question different from the proposed duplicate:
I want only the part of the div.background-pic
(the div with the background image) which is behind div.lower
(the div with the translucent blue color), to just appear to be blurred.
Explained:
As you can see, the div.background-pic
is position:fixed
(which means it is out of the flow, and does not scroll), while the rest of the page scrolls vertically, which implies that there are different parts of div.background-pic
behind the div.lower
at different times (while the page is being scrolled).
So it is obvious that we don't want to do anything to the div with the image itself, but do something (apply some kind of filter if there is one, etc.) on the div.lower
such that it causes the part of the background-image
of the div which is behind it, to appear blurred.
QUESTION:
In the following SSCCE, I want the part of the (background-image
of) .background-pic
which is behind .lower
(and is partially visible because .lower is translucent) to appear blurred out. Is that possible?
.background-pic {
background-image: url(http://khongthe.com/wallpapers/nature/beautiful-valley-45851.jpg);
background-size: cover;
position: fixed;
z-index: -1;
height: 400px;
width: 400px;
}
.top-blur {
height: 400px;
width: 400px;
overflow: auto;
}
.upper {
height: 300px;
width: 100%;
background-color: rgba(255, 127, 80, 0.5);
}
.lower {
height: 200px;
width: 100%;
background-color: rgba(0, 255, 255, 0.51);
}
<div class="background-pic">
<div class="top-blur">
<div class="upper"></div>
<div class="lower"></div>
</div>
</div>
NOTE: CSS only solution is preferred.