Tillitsdone
down Scroll to discover

CSS Backdrop-Filter Enhance Web Design with Blur & Filters

Learn about CSS backdrop-filter, a powerful tool for web designers.

Apply blur, brightness, contrast, and more to create stunning visual effects.
thumbnail

Formal Syntax

The backdrop-filter property in CSS allows you to apply graphical effects to the area behind an element. Here’s a detailed breakdown of its formal syntax:

backdrop-filter = none | <filter-value-list>
<filter-value-list> = [ <filter-function> | <url> ]+
<filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <sepia()> | <saturate()>
<url> = url(<string> <url-modifier>*) | <src()>
<blur()> = blur(<length>? )
<brightness()> = brightness([<number> | <percentage>]? )
<contrast()> = contrast([<number> | <percentage>]? )
<drop-shadow()> = drop-shadow([<color>? && <length>{2,3}] )
<grayscale()> = grayscale([<number> | <percentage>]? )
<hue-rotate()> = hue-rotate([<angle> | <zero>]? )
<invert()> = invert([<number> | <percentage>]? )
<opacity()> = opacity([<number> | <percentage>]? )
<sepia()> = sepia([<number> | <percentage>]? )
<saturate()> = saturate([<number> | <percentage>]? )

Explanation of Syntax Components

  • none: No filter is applied.
  • <filter-value-list>: A space-separated list of filter functions or an SVG filter URL that will be applied to the backdrop.
  • <filter-function>: Includes various functions such as blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), opacity(), sepia(), and saturate().
  • <url>: Specifies an SVG filter URL.

Examples

Here are some examples demonstrating how to use the backdrop-filter property:

Basic Example

.box {
background-color: rgba(255, 255, 255, 0.3); /* Semi-transparent background */
backdrop-filter: blur(10px); /* Apply a blur effect to the backdrop */
}
body {
background-image: url("anemones.jpg"); /* Background image */
}
html, body {
height: 100%;
width: 100%;
}
.container {
background-size: cover;
align-items: center;
display: flex;
justify-content: center;
height: 100%;
width: 100%;
}
.box {
border-radius: 5px;
font-family: sans-serif;
text-align: center;
max-width: 50%;
max-height: 50%;
padding: 20px 40px;
}
<div class="container">
<div class="box">
<p>backdrop-filter: blur(10px)</p>
</div>
</div>

Additional Examples

  • Brightness Effect
.foreground {
backdrop-filter: brightness(50%); /* Apply a brightness effect to the backdrop */
padding: 20px;
}
  • Contrast Effect
.foreground {
backdrop-filter: contrast(150%); /* Apply a contrast effect to the backdrop */
padding: 20px;
}
  • Grayscale Effect
.foreground {
backdrop-filter: grayscale(100%); /* Apply a grayscale effect to the backdrop */
padding: 20px;
}
  • Hue Rotate Effect
.foreground {
backdrop-filter: hue-rotate(90deg); /* Apply a hue rotate effect to the backdrop */
padding: 20px;
}
  • Invert Effect
.foreground {
backdrop-filter: invert(100%); /* Apply an invert effect to the backdrop */
padding: 20px;
}
  • Opacity Effect
.foreground {
backdrop-filter: opacity(50%); /* Apply an opacity effect to the backdrop */
padding: 20px;
}
  • Sepia Effect
.foreground {
backdrop-filter: sepia(100%); /* Apply a sepia effect to the backdrop */
padding: 20px;
}
  • Saturate Effect
.foreground {
backdrop-filter: saturate(200%); /* Apply a saturate effect to the backdrop */
padding: 20px;
}
  • Multiple Effects
.foreground {
backdrop-filter: blur(5px) brightness(120%) sepia(50%); /* Apply multiple effects to the backdrop */
padding: 20px;
}

Specifications

The backdrop-filter property is defined in the Filter Effects Module Level 2 specification. Here are the key details:

  • Specification Document: Filter Effects Module Level 2 # BackdropFilterProperty
  • Applies To: All elements; In SVG, it applies to container elements excluding the <defs> element and all graphics elements.
  • Inherited: No
  • Computed Value: As specified
  • Animation Type: A filter function list

Browser Compatibility

The backdrop-filter property is supported by various web browsers, but support may vary depending on the browser version. Here is an overview of the browser compatibility:

  • Google Chrome: Supported since version 76.0.
  • Microsoft Edge: Supported since version 17.0.
  • Mozilla Firefox: Supported since version 103.0.
  • Safari: Supported since version 9.0.
  • Opera: Supported since version 63.0.

To check the specific browser compatibility for the backdrop-filter property, you can refer to the Browser Compatibility Data (BCD) on MDN Web Docs.

See Also

For further reading and related topics, you can explore the following resources:

These resources provide additional information on related CSS properties and concepts, helping you gain a deeper understanding of web development and design. The backdrop-filter property is a powerful tool for modern web development, allowing for creative and innovative designs.

icons/css-4.svg CSS Blogs
CSS3 is the latest version of Cascading Style Sheets, offering advanced styling features like animations, transitions, shadows, gradients, and responsive design.
icons/logo-tid.svg

Talk with CEO

Ready to bring your web/app to life or boost your team with expert Thai developers?
Contact us today to discuss your needs, and let’s create tailored solutions to achieve your goals. We’re here to help at every step!
🖐️ Contact us
Let's keep in Touch
Thank you for your interest in Tillitsdone! Whether you have a question about our services, want to discuss a potential project, or simply want to say hello, we're here and ready to assist you.
We'll be right here with you every step of the way.
Contact Information
rick@tillitsdone.com+66824564755
Find All the Ways to Get in Touch with Tillitsdone - We're Just a Click, Call, or Message Away. We'll Be Right Here, Ready to Respond and Start a Conversation About Your Needs.
Address
9 Phahonyothin Rd, Khlong Nueng, Khlong Luang District, Pathum Thani, Bangkok Thailand
Visit Tillitsdone at Our Physical Location - We'd Love to Welcome You to Our Creative Space. We'll Be Right Here, Ready to Show You Around and Discuss Your Ideas in Person.
Social media
Connect with Tillitsdone on Various Social Platforms - Stay Updated and Engage with Our Latest Projects and Insights. We'll Be Right Here, Sharing Our Journey and Ready to Interact with You.
We anticipate your communication and look forward to discussing how we can contribute to your business's success.
We'll be here, prepared to commence this promising collaboration.
Frequently Asked Questions
Explore frequently asked questions about our products and services.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.