- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS Backdrop-Filter Enhance Web Design with Blur & Filters
Apply blur, brightness, contrast, and more to create stunning visual effects.
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 asblur(),brightness(),contrast(),drop-shadow(),grayscale(),hue-rotate(),invert(),opacity(),sepia(), andsaturate().<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:
filter<filter-function>background-blend-mode,mix-blend-mode- CSS filter effects
- CSS compositing and blending
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.
สร้างเว็บไซต์ 1 เว็บ ต้องใช้งบเท่าไหร่? เจาะลึกทุกองค์ประกอบ website development cost อยากสร้างเว็บไซต์แต่ไม่มั่นใจในเรื่องของงบประมาณ อ่านสรุปเจาะลึกตั้งแต่ดีไซน์, ฟังก์ชัน และการดูแล พร้อมตัวอย่างงบจริงจาก Till it’s done ที่แผนชัด งบไม่บานปลายแน่นอน
Next.js สอน 14 ขั้นตอนเบื้องต้น: สร้างโปรเจกต์แรกใน 30 นาที เริ่มต้นกับ Next.js ใน 14 ขั้นตอนเพียงแค่ 30 นาที พร้อม SSR/SSG และ API Routes ด้วยตัวอย่างโค้ดง่าย ๆ อ่านต่อเพื่อสร้างโปรเจ็กต์แรกได้ทันทีที่นี่
วิธีสมัคร Apple Developer Account เพื่อนำแอปขึ้น App Store ทีละขั้นตอน อยากปล่อยแอปบน App Store ระดับโลก มาอ่านคู่มือสมัคร Apple Developer Account พร้อมเคล็ดลับ TestFlight และวิธีอัปโหลดที่ง่ายในบทความเดียวนี้ได้เลย
TypeScript Interface คืออะไร? อธิบายพร้อมวิธีใช้และข้อแตกต่างจาก Type เรียนรู้วิธีใช้ TypeScript Interface เพื่อสร้างโครงสร้างข้อมูลที่ปลอดภัยและเข้าใจง่าย พร้อมเปรียบเทียบข้อดีข้อแตกต่างกับ Type ที่คุณต้องรู้ ถูกรวมเอาไว้ในบทความนี้แล้ว
Material-UI (MUI) คืออะไร อยากสร้าง UI สวยงามและเป็นมืออาชีพในเวลาอันรวดเร็วใช่ไหม มาทำความรู้จักกับ Material-UI (MUI) ที่ช่วยให้คุณพัฒนาแอปพลิเคชันบน React ได้ง่ายและดูดีในทุกอุปกรณ์
เปรียบเทียบ 3 วิธีติดตั้ง install node js บน Ubuntu: NVM vs NodeSource vs Official Repo แบบไหนดีที่สุด? เรียนรู้วิธีติดตั้ง Node.js บน Ubuntu ด้วย NVM, NodeSource หรือ Official Repo เลือกวิธีที่เหมาะกับความต้องการของคุณ พร้อมเปรียบเทียบ เพื่อการพัฒนาที่มีประสิทธิภาพ! Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.