CSS Reference ยท Filters, Masks and Shapes
The backdrop-filter property
Reference for the CSS backdrop-filter property: blur, tint or adjust everything behind an element to build frosted-glass panels, with examples and tips.
The backdrop-filter property applies filter effects to the area behind an element, not to the element itself. Its best-known use is the "frosted glass" look: a translucent panel that blurs whatever scrolls underneath it.
It accepts the same functions as filter. For the effect to be visible, the element must be at least partly transparent, because you see the filtered backdrop through the element's own background.
.glass { background: rgb(255 255 255 / 0.25); backdrop-filter: blur(8px) saturate(1.4); }
Try it
On the left the panel itself, label included, is blurred. On the right the label stays sharp while the stripes behind it are blurred.
Syntax
backdrop-filter: none | <filter-value-list>
- Initial value:
none - Applies to: all elements
- Inherited: no
- Animatable: yes
- Computed value:
none, or the list of functions with lengths made absolute
Values
| Value | Description |
|---|---|
none |
No effect on the backdrop. |
<filter-function> |
Any function accepted by filter: blur(), brightness(), contrast(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), sepia() and drop-shadow(). |
url(#id) |
Reference to an SVG filter. |
Usage notes
- Needs transparency. An opaque background hides the effect completely. Use an
rgb()orhsl()color with an alpha channel. - The backdrop is what is painted behind the element within its root stacking context. Content you expect to see blurred must actually be painted behind it.
- Edges. The area is clipped to the element's border box, including rounded corners (
border-radiusis respected). - Creates a stacking context when set to anything other than
none, and the element becomes the containing block for fixed-position descendants, likefilter. - Performance. The browser re-computes the blur whenever the backdrop changes (scrolling, video, animation). Large panels with big blur radii cost battery; keep blur modest.
- Provide a fallback. Use
@supports (backdrop-filter: blur(1px))to give unsupported browsers a more opaque background so text stays readable. - Contrast. Blurring reduces detail but not color; check text contrast against the brightest and darkest possible backdrops.
Browser support
Supported in current versions of all major browsers; older Safari versions needed the -webkit-backdrop-filter prefix, so include it if you still serve those.
Related
filterโ filters the element itselfblur() and filter functionsโ the available functionsopacityโ transparency for the whole elementmix-blend-modeโ blends with the content behind- Lesson: Filters