Add a graphical effect to the area behind an element:
div.transbox {
background-color: rgba(255, 255, 255, 0.4);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
}
Try it Yourself »
The backdrop-filter
property is used to apply a graphical effect to the area behind an element.
Tip: To see the effect, the element or its background must be at least partially transparent.
Default value: | none |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.backdropFilter="grayscale(100%)" |
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -webkit- specifies the first version that worked with a prefix.
Property | |||||
---|---|---|---|---|---|
backdrop-filter | 76.0 | 17.0 | 70.0* | 9.0 -webkit- | 63.0 |
* To get this to work, open about:config and set thelayout.css.backdrop-filter.enabled to true, and also the gfx.webrender.all preferences needs to be set to true.
backdrop-filter: none|
filter|initial|inherit;
Value | Description | Demo |
---|---|---|
none | Default value. No filter is applied to the backdrop | Demo ❯ |
filter | A space-separated list of filter-functions like:
or an url to an SVG filter that will be applied to the backdrop |
Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS Reference: filter property
CSS Tutorial: CSS Images
HTML DOM reference: filter property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!