Backdrop-filter - Property CSS

backdrop-filter

Summary of characteristics of the backdrop-filter property

Quick description
Applies a graphical filter to the clip behind the targeted clip.
Status
Standard
Usable for
HTML
Predefined values
none
Initial value
none
Inherited by default
No.
Animation type
Computed value : during an animation, the backdrop-filter property gradually changes from one value to another.
W3C Module
Filter Effects Module
References (W3C)
Document status: ED (Editor's draft)

Syntactic schema of backdrop-filter.

backdrop-filter - Syntax DiagramSyntax diagram of the backdrop-filter CSS property. See stylescss.free.fr for details. none none filter filter url('url'url('url')backdrop-filter:;backdrop-filter:;
Syntax scheme of the property backdrop-filter
Detailed syntax

Legend :

What is the role of the CSS property backdrop-filter?

The backdrop-filter property defines a graphical filter (blur, shading, etc.) that will be applied to the element behind the element designated by the selector. For the effect to be visible, it must of course have a transparent background or at least with an opacity of less than 1.

For example, here's what you can get with backdrop-filter.

To make the text easier to read, the background of the background element has been brightened.
The color of the background element has been changed (color rotation with hue-rotate() ) behind this second block.
The contrast of the background element has been reduced to make the text easier to read.

Syntaxes for backdrop-filter.

  • backdrop-filter: none;

    Default. No graphic effects are applied.

  • backdrop-filter: blur(); backdrop-filter: brightness(); backdrop-filter: contrast() ; backdrop-filter: drop-shadow(); backdrop-filter: grayscale() ; backdrop-filter: hue-rotate() ; backdrop-filter: invert() ; backdrop-filter: opacity() ; backdrop-filter: sepia() ; backdrop-filter: saturate() ;

    All of these functions apply a graphical filter (contrast, color change, etc.) that can be used with backdrop-filter. Click on the names of the functions to specify their effect or settings.

    In the example below, the color of the text is close to that of the gradient in the background, making the text unreadable. You will be able to see the presence of a first line of text by selecting it.
    By reducing the brightness of the background on the second line, readability is greatly improved.

    Text illegible because in a color close to that of the background
    Improved readability with backdrop-filter:brightness(0.5);
  • backdrop-filter: url() ;

    Applies the graphical treatments defined in the specified file (in SVG format).

    The example below applies SVG-defined blur to the second line of text to improve readability.
    This example does not work on Firefox   (2024).

    Text barely legible due to an overly contrasting background
    Improved readability with an SVG filter
    backdrop-filter:url('#blur');
  • backdrop-filter: blur() sepia() opacity() ;

    A series of values, separated by spaces: application of a succession of filters.

    Improved readability by blurring and rotating colors

Global values
(common to all properties):

backdrop-filter: initial (none) backdrop-filter: inherit backdrop-filter: revert backdrop-filter: revertLayer backdrop-filter: unset

See the following pages for more details: initial, inherit, revert, revert-layer, unset.

Animation of the property backdrop-filter.

The backdrop-filter property can be animated by the graphical functions it uses. Indeed, these functions all accept one or more numerical values as parameters.

Example of an effect obtained by animating
the backdrop-filter property
and the blur() function

 

Manipulating the backdrop-filter property programmatically.

Change the value of backdrop-filter to Javascript.

In Javascript, here's how to change the value of backdrop-filter. We can see that Javascript accepts a syntax with the typical CSS notation, in kebab-case (a hyphen to separate words), and another syntax with camel-case notation (a capital letter to separate words).

Javascript
let el = document.getElementById('id'); el.style['backdrop-filter'] = 'blur()'; // or let el = document.getElementById('id'); el.style.backdropFilter = 'blur()';

Read in Javascript the value of backdrop-filter.

For the code below to work, the property must have been assigned directly to the element itself in HTML, via the style attribute, and not by going through a CSS selector.

Javascript
let el = document.getElementById('id'); let value = el.style['backdrop-filter']; // or let el = document.getElementById('id'); let value = el.style.backdropFilter;

Read the computed value of backdrop-filter in Javascript.

The calculated value is always set. It results from the inheritance cascade, and if no value is set for this property, the calculated value will be the initial value of the property (none for backdrop-filter).

Javascript
let el = document.getElementById('id'); let value = window.getComputedStyle(el).getPropertyValue('backdrop-filter');

Change the value of the backdrop-filter property with JQuery.

As in Javascript, the name of the property can be written in kebab-case or camel-case.

JQuery

$('#id').css('backdrop-filter', 'blur()');
// or
$('#id').css('backdropFilter', 'blur()');

Read the calculated value of the backdrop-filter property with JQuery.

JQuery
let value = $('#id').css('backdrop-filter');

Other code samples.

More examples of Javascript and JQuery code are given on the Javascript and CSS page.

Test it yourself.

The buttons below apply the entered value to the backdrop-filter property and then display either the value as applied, or the calculated value. This second option allows you to see how the value of backdrop-filter is stored (serialized). In particular, we note that the percentages are well remembered as percentages (see the chapter on inheritance). All other units are converted to pixels.

Simulator.

backdrop-filter :
This text may be difficult to read because of the very heavy background of the parent element.
The backdrop-filter property helps to fix things.

Browser support for backdrop-filter.

The backdrop-filter property is now recognized by most modern browsers.

Column 1
Support for the backdrop-filter property to apply a filter behind the element.
1
backdrop-filter
property
Estimated overall support.
96%

Browsers on computers :

Mobile browsers :

Outdated or marginal browsers :

Internet Explorer

KaiOS Browser

Opéra Mobile

Chrome

Edge

Opéra

Safari

Safari sur IOS

Androïd Brower

Chrome pour Androïd

Firefox pour Androïd

Samsung Internet

Firefox

Baidu Browser

QQ Browser

UC Browser pour Androïd

Opéra mini

backdrop-filter property history.

See also, about graphical filters.

The various filters and graphic effects are described in the specification named "Filter Effects Module" All standardization texts are published by the W3C. Here are the terms for graphical filters:

Properties:

color-interpolation
Langue française
Defines the color space to use to calculate gradients, animations, and combinations with the alpha channel.
color-interpolation-filters
Langue française
Defines in which color space the filter effects are calculated. Default is linearRGB.
filter
Langue française
Applies a graphic filter (blur, contrast, brightness, etc.) to an element.
flood-color
Langue française
Sets the color of fills and shading in the context of SVG filters.
flood-opacity
Langue française
Sets the opacity of fills and shadings in the context of SVG filters.
lighting-color
Langue française
Sets the color of the lighting in the context of an SVG filter.

Functions:

blur()
blur() is a graphical filter that can be used with the filter property. The function applies a blur effect to the clip.
brightness()
Adjusts the brightness of an element (graphic filter).
contrast()
Langue française
Adjusts the contrast of an element (graphic filter).
drop-shadow()
Sets the shadow of an element: dimensions, blur, color (graphic filter).
grayscale()
Langue française
Converts an element to grayscale (graphic filter) in a less complete way. In the extreme, colors can be completely removed.
hue-rotate()
Langue française
Changes the colors of an image by rotating hues (graphic filter).
invert()
Langue française
Inverts the colors of an element (graphic filter).
opacity()
Langue française
Determines how transparent an element is (graphic filter).
saturate()
Langue française
Sets the color saturation of an element (graphic filter).
sepia()
Langue française
Applies a sepia effect to an element (graphics filter).