CSS backdrop-filter Property
The backdrop-filter property applies graphical effects, such as blur, brightness, and color adjustments, to the area behind an element.
Unlike the filter property, which affects an element's own rendered content, backdrop-filter changes the appearance of content visible through the element. It is commonly used to create frosted-glass panels, translucent navigation bars, overlays, and other layered interface effects.
backdrop-filter Syntax
selector {
backdrop-filter: blur(10px);
}
The property accepts none or a space-separated list of filter functions and SVG filter references.
.default-backdrop {
backdrop-filter: none;
}
.blurred-backdrop {
backdrop-filter: blur(10px);
}
.bright-backdrop {
backdrop-filter: brightness(1.2);
}
.dark-backdrop {
backdrop-filter: brightness(0.6);
}
.desaturated-backdrop {
backdrop-filter: grayscale(100%);
}
.combined-backdrop {
backdrop-filter: blur(8px) saturate(150%);
}
.svg-backdrop {
backdrop-filter: url("#custom-filter");
}
Multiple filters are separated by spaces, not commas. They are applied in the order listed.
The property also accepts CSS-wide values such as inherit, initial, revert, revert-layer, and unset.
Property Values
| Value | Description |
|---|---|
none |
Applies no backdrop filtering. This is the initial value. |
blur(10px) |
Blurs the content behind the element using a specified blur radius. |
brightness(1.2) |
Increases the brightness of the backdrop. |
contrast(150%) |
Increases the contrast of the backdrop. |
grayscale(100%) |
Converts the backdrop to grayscale. |
hue-rotate(90deg) |
Rotates the hues of the backdrop colors. |
invert(100%) |
Inverts the backdrop colors. |
opacity(50%) |
Reduces the opacity of the filtered backdrop image. |
saturate(150%) |
Increases the color saturation of the backdrop. |
sepia(100%) |
Applies a sepia color effect to the backdrop. |
url("#filter-id") |
References an SVG filter definition. |
The property applies to all elements, is not inherited, and has an initial value of none. It is animatable using the interpolation rules for filter function lists.
The computed value is the specified filter function list, with applicable lengths and other values resolved according to their individual computed-value rules.
The drop-shadow() function is not part of the standard backdrop-filter function syntax. Use box-shadow for shadows around a panel or filter: drop-shadow() for appropriate element effects.
How backdrop-filter Works
The backdrop-filter property operates on the rendered backdrop behind an element rather than directly filtering the element's own text, borders, or foreground content.
For the effect to be visible, at least part of the element must allow the filtered backdrop to show through. This usually means using a transparent or semi-transparent background.
.glass-panel {
background-color: rgb(255 255 255 / 30%);
backdrop-filter: blur(12px);
}
The semi-transparent background allows the blurred backdrop to remain visible while adding a light tint to the panel.
Opaque Backgrounds
.opaque-panel {
background-color: #fff;
backdrop-filter: blur(12px);
}
The filter is still specified, but the solid white background covers the filtered backdrop. As a result, the blur is generally not visible through the element.
Transparent Backgrounds
.transparent-panel {
background-color: transparent;
backdrop-filter: blur(12px);
}
With a transparent background, the filtered backdrop can be seen without an additional background tint.
Backdrop Boundaries
Backdrop filtering operates within the element's backdrop root and visible filtering region. Properties such as border-radius can clip the visible result to a rounded shape.
Certain ancestor properties can also establish backdrop roots, changing which background content is available to be filtered. This matters when building nested translucent overlays.
Backdrop Filter Functions
Several CSS filter functions can be used with backdrop-filter to create different visual effects.
blur()
The blur() function softens the backdrop by applying a Gaussian blur.
.panel {
backdrop-filter: blur(10px);
}
Larger blur radii generally produce stronger blurring. The function accepts a nonnegative length.
brightness()
The brightness() function adjusts the brightness of the backdrop.
.panel {
backdrop-filter: brightness(0.7);
}
A value of 1 or 100% leaves brightness unchanged. Lower values darken the backdrop, while higher values brighten it.
contrast()
The contrast() function adjusts the difference between light and dark areas.
.panel {
backdrop-filter: contrast(150%);
}
A value of 100% leaves contrast unchanged. Higher values increase contrast, while lower values reduce it.
grayscale()
The grayscale() function reduces color saturation toward grayscale.
.panel {
backdrop-filter: grayscale(100%);
}
A value of 100% produces a fully grayscale backdrop. A value of 0% leaves the colors unchanged.
hue-rotate()
The hue-rotate() function rotates backdrop colors around the color wheel.
.panel {
backdrop-filter: hue-rotate(90deg);
}
Angle values control the amount of hue rotation. A value of 0deg leaves the hues unchanged.
invert()
The invert() function reverses the backdrop colors.
.panel {
backdrop-filter: invert(100%);
}
A value of 100% produces full inversion, while 0% leaves the backdrop unchanged.
opacity()
The opacity() filter function adjusts the opacity of the filtered backdrop image.
.panel {
backdrop-filter: opacity(50%);
}
This is different from the CSS opacity property, which changes the opacity of an entire element, including its content.
saturate()
The saturate() function increases or decreases the intensity of backdrop colors.
.panel {
backdrop-filter: saturate(180%);
}
A value of 100% leaves saturation unchanged. Higher values increase saturation, while lower values reduce it.
sepia()
The sepia() function applies a warm, brown-toned color effect.
.panel {
backdrop-filter: sepia(80%);
}
A value of 100% applies the full sepia effect, while 0% leaves the backdrop unchanged.
Combining Multiple Filters
Multiple filter functions can be combined in one backdrop-filter declaration.
.glass-panel {
backdrop-filter: blur(12px) brightness(1.1) saturate(150%);
}
This combination blurs the backdrop, increases its brightness, and enhances color saturation.
Filter functions are processed in the order they appear. Changing that order can produce different visual results.
.first-panel {
backdrop-filter: grayscale(100%) sepia(100%);
}
.second-panel {
backdrop-filter: sepia(100%) grayscale(100%);
}
The first declaration converts the backdrop to grayscale before applying sepia. The second applies sepia first and then converts the result to grayscale.
Combining several effects can be useful, but excessive filtering may reduce readability or increase rendering costs.
Creating a Frosted-Glass Effect
One of the most common uses of backdrop-filter is creating a frosted-glass effect.
This design combines backdrop blur, a translucent background, a subtle border, and optional shadow styling.
.frosted-panel {
padding: 24px;
border: 1px solid rgb(255 255 255 / 50%);
border-radius: 12px;
background-color: rgb(255 255 255 / 25%);
backdrop-filter: blur(14px) saturate(150%);
box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}
The blur softens the background, while the semi-transparent white layer helps separate the panel from the content behind it.
Translucent Navigation Bars
.site-navigation {
position: sticky;
top: 0;
z-index: 10;
background-color: rgb(255 255 255 / 80%);
backdrop-filter: blur(10px);
}
As content scrolls behind the navigation bar, the backdrop blur softens the underlying content while the navigation text remains sharp.
Dark Glass Panels
.dark-glass {
color: #fff;
background-color: rgb(0 0 0 / 55%);
backdrop-filter: blur(12px);
border: 1px solid rgb(255 255 255 / 20%);
}
A dark translucent background can help maintain text contrast when the content behind the panel is bright or visually complex.
Always test text readability against different backgrounds. A blurred backdrop alone does not guarantee sufficient contrast.
Using SVG Filters
The backdrop-filter property can reference an SVG filter using the url() function.
<svg width="0" height="0" aria-hidden="true" focusable="false">
<defs>
<filter id="backdrop-grayscale">
<feColorMatrix type="saturate" values="0"></feColorMatrix>
</filter>
</defs>
</svg>
<div class="svg-filter-panel">
SVG-filtered backdrop
</div>
.svg-filter-panel {
background-color: rgb(255 255 255 / 30%);
backdrop-filter: url("#backdrop-grayscale");
}
The SVG filter definition converts the filtered backdrop to grayscale where the browser supports SVG filter references in backdrop-filter.
SVG filters provide additional graphical operations beyond the built-in CSS filter functions. However, support and rendering behavior can vary, especially with external SVG resources.
For common effects such as blur or grayscale, CSS filter functions are generally simpler and more portable.
filter vs. backdrop-filter
The filter and backdrop-filter properties use many of the same filter functions, but they affect different rendered content.
| Property | What It Affects |
|---|---|
filter |
Applies effects to the element's own rendered content, including its descendants. |
backdrop-filter |
Applies effects to the backdrop behind the element while leaving its foreground content unfiltered by that property. |
Using filter
.blurred-element {
filter: blur(8px);
}
The element's rendered content becomes blurred, including text and images inside it.
Using backdrop-filter
.glass-element {
background-color: rgb(255 255 255 / 30%);
backdrop-filter: blur(8px);
}
The background behind the element becomes blurred, but the element's own text and foreground content remain sharp.
Use filter when you want to modify the element itself. Use backdrop-filter when you want to modify what is visible behind it.
backdrop-filter Example
The following example compares a panel without backdrop filtering to one with a blur effect.
Both panels use the same translucent background. The second panel applies backdrop-filter: blur(10px) to soften the decorative background visible through it.
<div class="backdrop-demo">
<div class="backdrop-card no-filter">
<strong>Without Filter</strong>
<p>The background remains sharp.</p>
</div>
<div class="backdrop-card with-filter">
<strong>With backdrop-filter</strong>
<p>The background appears blurred.</p>
</div>
</div>
.backdrop-demo {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 20px;
min-height: 260px;
padding: 25px 15px;
box-sizing: border-box;
background-color: #1769aa;
background-image: repeating-linear-gradient(45deg, #1769aa 0, #1769aa 12px, #ffcf66 12px, #ffcf66 24px);
}
.backdrop-card {
flex: 1 1 170px;
max-width: 240px;
min-height: 150px;
padding: 20px;
box-sizing: border-box;
border: 1px solid rgb(255 255 255 / 70%);
border-radius: 10px;
background-color: rgb(255 255 255 / 55%);
color: #172b40;
text-align: center;
}
.backdrop-card strong {
display: block;
margin-bottom: 12px;
}
.backdrop-card p {
margin: 0;
}
.backdrop-card.no-filter {
backdrop-filter: none;
}
.backdrop-card.with-filter {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
The diagonal stripes make the effect easier to recognize. The filtered panel softens the stripes behind it while keeping its text readable.
The background remains sharp.
The background appears blurred.
The left panel displays the striped backdrop through its translucent background without blurring it. The right panel blurs the same background using backdrop-filter.
Both panels retain sharp text because the backdrop filter does not directly blur their foreground content.
In browsers without backdrop-filter support, both panels remain readable and use their semi-transparent background colors.
Performance and Accessibility
Backdrop filtering can require additional rendering work because the browser must process the content behind the filtered element.
Limit Large Filtered Areas
Large blurred overlays and multiple overlapping filtered elements may increase rendering costs, especially on mobile devices.
Use moderate blur values and test scrolling performance when applying filters to fixed or sticky elements.
Maintain Text Contrast
Background content can change as users scroll, so text that is readable over one backdrop may become difficult to read over another.
.readable-panel {
color: #172b40;
background-color: rgb(255 255 255 / 85%);
backdrop-filter: blur(10px);
}
A sufficiently opaque background tint can improve readability and provide a useful fallback when backdrop filtering is unavailable.
Respect Transparency Preferences
Some users prefer reduced transparency because translucent surfaces can make interface content harder to distinguish.
.glass-panel {
background-color: rgb(255 255 255 / 80%);
backdrop-filter: blur(10px);
}
@media (prefers-reduced-transparency: reduce) {
.glass-panel {
background-color: #fff;
backdrop-filter: none;
}
}
The prefers-reduced-transparency media feature allows supporting browsers to provide a solid background when the user requests reduced transparency.
Since support for this preference varies, a readable default background remains important.
Important Considerations
Keep the following points in mind when using backdrop-filter:
- Default value: The initial value is
none, which applies no backdrop filtering. - Backdrop content: The property filters rendered content behind an element, not the element's own foreground content.
- Transparency: A transparent or semi-transparent background is generally necessary for the effect to be visible.
- Filter functions: Functions such as
blur(),brightness(),contrast(), andsaturate()can be combined. - Filter order: Multiple functions are applied in their listed order, which can affect the result.
- Rounded corners: The visible backdrop effect follows the element's clipping and border-radius boundaries.
- Backdrop roots: Certain ancestor properties can limit which background content is available for filtering.
- Performance: Large or overlapping filtered areas may increase rendering costs.
- Browser compatibility: Modern browsers support the property, but older browsers may require the
-webkit-backdrop-filterprefix or lack support entirely. - Accessibility: Provide sufficient text contrast and a readable fallback when transparency or filtering is unavailable.
Use backdrop-filter when a translucent element needs to visually separate itself from the content behind it without obscuring that content completely.
Browser Support
The backdrop-filter property is Baseline Newly available, with support across current major browser engines. Older browser versions may not support it or may require a vendor-prefixed declaration.
For compatibility with older WebKit-based browsers, include the prefixed declaration before the standard property.
.glass-panel {
background-color: rgb(255 255 255 / 85%);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
The background color remains visible even if the browser does not support backdrop filtering.
You can also use @supports to apply the effect conditionally.
.glass-panel {
background-color: rgb(255 255 255 / 90%);
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
.glass-panel {
background-color: rgb(255 255 255 / 60%);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
}
Visit Can I Use? to check current browser compatibility.
Specifications
The backdrop-filter property is defined in the Filter Effects Module Level 2 specification.
