Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

backdrop-filter — filtering pixels behind a translucent element

`backdrop-filter` filters the backdrop image behind an element and then composites the element’s own background, border, and children over that filtered result.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

none | <filter-value-list>

backdrop-filter filters the backdrop image behind an element and then composites the element’s own background, border, and children over that filtered result.

Changing the panel from none to blur(4px) moves its fixed descendant’s left edge from 0px to 40px, proving creation of a containing block; the filter is clipped to 180x60 and the panel remains translucent at rgba(255, 255, 255, 0.25).

Grammar: none | <filter-value-list>.

Unlike filter, this property processes the Backdrop Root Image, not the element’s own pixels. Operations run left to right in sRGB, and the final image is clipped to the border box including border-radius; without transparency the filtered backdrop is usually hidden by the element’s background. Any value other than none creates a stacking context and a containing block for absolute and fixed descendants (except at the document root), even with a visually small radius. Filter Effects Level 2 is an Editor’s Draft written for discussion and explicitly lacks Working Group consensus, so isolate the effect, provide a readable fallback, and verify performance and support. Filter Effects Level 2 inherits Level 1 privacy and security restrictions. An external url() SVG reference filter uses CORS in Anonymous mode with the stylesheet URL as referrer and the containing-document origin; a network failure makes the reference act as none. A tainted primitive must run constant-time with respect to pixel values to prevent timing disclosure. UAs should not apply an SVG reference filter, including via backdrop-filter, to pixel data from a restricted/cross-origin iframe or web plugin, because manipulating inaccessible content enables clickjacking.

Examples

document.body.innerHTML =
  '<style>body{margin:0}.scene{position:relative;margin-left:40px;width:180px;height:60px;background:linear-gradient(90deg,#f00 50%,#00f 50%)}.panel{position:absolute;inset:0;background:rgb(255 255 255 / .25)}.child{position:fixed;left:0;top:0;width:1px;height:1px}.filtered{backdrop-filter:blur(4px)}</style>' +
  '<div class="scene"><div class="panel"><i class="child"></i></div></div>';
const panel=document.querySelector('.panel'),child=document.querySelector('.child');
await new Promise(requestAnimationFrame);
const before=Math.round(child.getBoundingClientRect().left)+'/'+getComputedStyle(panel).backdropFilter;
panel.classList.add('filtered');
await new Promise(requestAnimationFrame);
const after=Math.round(child.getBoundingClientRect().left)+'/'+getComputedStyle(panel).backdropFilter;
console.log('before='+before+'; after='+after+'; clip='+Math.round(panel.getBoundingClientRect().width)+'x'+Math.round(panel.getBoundingClientRect().height)+'; transparent='+getComputedStyle(panel).backgroundColor);

Result

before=0/none; after=40/blur(4px); clip=180x60; transparent=rgba(255, 255, 255, 0.25)

`backdrop-filter` filters the backdrop image behind an element and then composites the element’s own background, border, and children over that filtered result.

Sources