backdrop-filter
Quick Summary for backdrop-filter
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.
Code Usage for backdrop-filter

<pre class="brush: css notranslate"><code><span class="token comment">/ Keyword value /</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token comment">/ URL to SVG filter /</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>commonfilters.svg#filter<span class="token punctuation">)</span></span><span class="token punctuation">;</span> <span class="token comment">/ &lt;filter-function&gt; values /</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">blur</span><span class="token punctuation">(</span>2px<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">brightness</span><span class="token punctuation">(</span>60%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">contrast</span><span class="token punctuation">(</span>40%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">drop-shadow</span><span class="token punctuation">(</span>4px 4px 10px blue<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">grayscale</span><span class="token punctuation">(</span>30%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">hue-rotate</span><span class="token punctuation">(</span>120deg<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">invert</span><span class="token punctuation">(</span>70%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">opacity</span><span class="token punctuation">(</span>20%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">sepia</span><span class="token punctuation">(</span>90%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token function">saturate</span><span class="token punctuation">(</span>80%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">/ Multiple filters /</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>filters.svg#filter<span class="token punctuation">)</span></span> <span class="token function">blur</span><span class="token punctuation">(</span>4px<span class="token punctuation">)</span> <span class="token function">saturate</span><span class="token punctuation">(</span>150%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">/ Global values /</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> inherit<span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> initial<span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> revert<span class="token punctuation">;</span> <span class="token property">backdrop-filter</span><span class="token punctuation">:</span> unset<span class="token punctuation">;</span> </code></pre>

More Details for backdrop-filter

backdrop-filter

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.

/* 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: unset; 

Syntax

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.

Formal definition

Initial valuenone
Applies toall elements; In SVG, it applies to container elements excluding the defs element and all graphics elements
Inheritedno
Computed valueas specified
Animation typea filter function list

Formal syntax

none | <filter-function-list>

where <filter-function-list> = [ <filter-function> | <url> ]+

where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>

where <blur()> = blur( <length> )<brightness()> = brightness( <number-percentage> )<contrast()> = contrast( [ <number-percentage> ] )<drop-shadow()> = drop-shadow( <length>{2,3} <color>? )<grayscale()> = grayscale( <number-percentage> )<hue-rotate()> = hue-rotate( <angle> )<invert()> = invert( <number-percentage> )<opacity()> = opacity( [ <number-percentage> ] )<saturate()> = saturate( <number-percentage> )<sepia()> = sepia( <number-percentage> )

where <number-percentage> = <number> | <percentage><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>

where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<hwb()> = hwb( [<hue> | none] [<percentage> | none] [<percentage> | none] [ / [<alpha-value> | none] ]? )

where <alpha-value> = <number> | <percentage><hue> = <number> | <angle>

Examples

CSS

.box {   background-color: rgba(255, 255, 255, 0.3);   border-radius: 5px;   font-family: sans-serif;   text-align: center;   line-height: 1;  -webkit-backdrop-filter: blur(10px);   backdrop-filter: blur(10px);   max-width: 50%;   max-height: 50%;   padding: 20px 40px; }  html, body {   height: 100%;   width: 100%; }  body {   background-image: url(https://picsum.photos/id/1080/6858/4574), linear-gradient(rgb(219, 166, 166), rgb(0, 0, 172));   background-position: center center;   background-repeat: no-repeat;   background-size: cover; }  .container {   align-items: center;   display: flex;   justify-content: center;   height: 100%;   width: 100%; } 

HTML

<div class="container">   <div class="box">     <p>backdrop-filter: blur(10px)</p>   </div> </div> 

Result

Specifications

Specification
Filter Effects Module Level 2 # BackdropFilterProperty

See also

filter

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語한국어Português (do Brasil)Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
Treasure every moment that you have and treasure it more because you shared it with someone special, special enough to spend your time...and remember that time waits for no one.
Unknown
Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.