The backdrop-filter
CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything behind the element, to see the effect you must make the element or its background at least partially transparent.
Syntax
/* Keyword value */ backdrop-filter: none; /* URL to SVG filter */ backdrop-filter: url(commonfilters.svg#filter); /* <filter-function> values */ backdrop-filter: blur(2px); backdrop-filter: brightness(60%); backdrop-filter: contrast(40%); backdrop-filter: drop-shadow(4px 4px 10px blue); backdrop-filter: grayscale(30%); backdrop-filter: hue-rotate(120deg); backdrop-filter: invert(70%); backdrop-filter: opacity(20%); backdrop-filter: sepia(90%); backdrop-filter: saturate(80%); /* Multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* Global values */ backdrop-filter: inherit; backdrop-filter: initial; backdrop-filter: revert; backdrop-filter: revert-layer; backdrop-filter: unset;
Values
none
-
No filter is applied to the backdrop.
<filter-function-list>
-
A space-separated list of
<filter-function>
s or an SVG filter that will be applied to the backdrop. CSS<filter-function>
s includeblur()
,brightness()
,contrast()
,drop-shadow()
,grayscale()
,hue-rotate()
,invert()
,opacity()
,saturate()
, andsepia()
.
Formal definition
Initial value | none |
---|---|
Applies to | All elements. In SVG, it applies to container elements without the defs element and all graphics elements |
Inherited | no |
Computed value | as specified |
Formal syntax
none | <filter-value-list>
Examples
CSS
.box { background-color: rgb(255 255 255 / 0.3); backdrop-filter: blur(10px); } body { background-image: url("anemones.jpg"); }
HTML
<div class="container"> <div class="box"> <p>backdrop-filter: blur(10px)</p> </div> </div>