What is the difference between backdrop-filter and filter properties in css
Hello guys, sorry to disturb you all, can someone explain what is the difference between backdrop-filter and filter properties in css please
For eg, consider the following code:
What I wanted is to blur the background image and keep my container intact but when I try to use filter on the background image, found in body, it is the contain who gots blurred. Now if I use backdrop-filter, what this does, this basically blurrs whatever is found behind the element being targetted that is a small portion of the background image
9 Replies
backdrop-filter only applies to the background
filter applies to the entire element
ah, backdrop filter, filters part of the background that this particular element takes while filter applies to both background and content of element ?
yes, that's it
and it's not "part of the background" - it filters the background
hmm it filters the entire background or only part of the background behind that particular element ?
the entire background of the element
Vsually its easiest with blur for me
https://codepen.io/Chris-Rowe/pen/RwXLLrm
yep I see , ty
so backdrop-filter, it doesn not filter all background image but only the portion behind our container being targeted, right ?
yeah box 1 (filter), the whole box is blurry including its edges
box 2 (backdrop-filter) text is not blurry, edges of div are not blurry, but the stuff behind it looks blurred (great for "glass" style UI implmentations)
Box 3 is a control and the backdrop fill for all of these is a transparent red
yep I see, ty !!