- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS backdrop-filter
The CSS property backdrop-filter helps you in adding graphical effects to the area behind an element, i.e., to the backdrop of an element. As this property add the effects such as blurring, behind the element, the element needs to be fully or partially transparent for the effect to be visible.
Possible Values
The backdrop-filter CSS property can have one of the following values:
none: No filter to be applied to the backdrop of the element.
<filter-function-list>: It is a space-separated list of <filter-function>s, which will be applied to the backdrop of an element. The functions that are included are: blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), and sepia().
Applies To
All html elements. In SVG, it applies to container elements excluding the <defs> element and all graphics elements
Syntax
/* Keyword Value */ backdrop-filter: none; /* <filter-function> values */ backdrop-filter: blur(4px); backdrop-filter: brightness(80%); backdrop-filter: contrast(20%); backdrop-filter: drop-shadow(2px 2px 8px red); backdrop-filter: grayscale(60%); backdrop-filter: hue-rotate(100deg); backdrop-filter: invert(80%); backdrop-filter: opacity(40%); backdrop-filter: saturate(90%); backdrop-filter: sepia(70%); /* Multiple filters */ backdrop-filter: blur(4px) saturate(90%);
CSS backdrop-filter - none Value
The following example demonstrates the use of backdrop-filter: none property which adds no filter to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/red-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .nofilter-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: none CSS Property</h1> <div class="background-img"> <div class="blur-box"> <p>backdrop-filter: none</p> </div> </div> </body> </html>
CSS backdrop-filter - blur() Value
The following example demonstrates the use of backdrop-filter: blur() property to blur the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/scenery2.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .blur-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: blur() CSS Property</h1> <div class="background-img"> <div class="blur-box"> <p>backdrop-filter: blur(15px)</p> </div> </div> </body> </html>
CSS backdrop-filter - brightness() Value
The following example demonstrates the use of backdrop-filter: brightness() property to brighten the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .bright-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: brightness(50%); backdrop-filter: brightness(50%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: brightness() CSS Property</h1> <div class="background-img"> <div class="bright-box"> <p>backdrop-filter: brightness(50%)</p> </div> </div> </body> </html>
CSS backdrop-filter - contrast() Value
The following example demonstrates the use of backdrop-filter: contrast() property to add contrast to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .contrast-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: contrast(10%); backdrop-filter: contrast(10%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: contrast() CSS Property</h1> <div class="background-img"> <div class="contrast-box"> <p>backdrop-filter: contrast(10%)</p> </div> </div> </body> </html>
CSS backdrop-filter - grayscale() Value
The following example demonstrates the use of backdrop-filter: grayscale() property to add grayscale effect to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .gray-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: grayscale(70%); backdrop-filter: grayscale(70%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: grayscale() CSS Property</h1> <div class="background-img"> <div class="gray-box"> <p>backdrop-filter: grayscale(70%)</p> </div> </div> </body> </html>
CSS backdrop-filter - hue-rotate() Value
The following example demonstrates the use of backdrop-filter: hue-rotate() property to add the hue-rotate effect to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .hue-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: hue-rotate(120deg); backdrop-filter: hue-rotate(120deg); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: hue-rotate() CSS Property</h1> <div class="background-img"> <div class="hue-box"> <p>backdrop-filter: hue-rotate(120deg)</p> </div> </div> </body> </html>
CSS backdrop-filter - invert() Value
The following example demonstrates the use of backdrop-filter: invert() property to add the invert effect to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .invert-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: invert(70%); backdrop-filter: invert(70%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: invert() CSS Property</h1> <div class="background-img"> <div class="invert-box"> <p>backdrop-filter: invert(70%)</p> </div> </div> </body> </html>
CSS backdrop-filter - opacity() Value
The following example demonstrates the use of backdrop-filter: opacity() property to adjust the transparency effect of the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/red-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .opacity-box { background-color: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: opacity(10%); backdrop-filter: opacity(10%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: opacity() CSS Property</h1> <div class="background-img"> <div class="opacity-box"> <p>backdrop-filter: opacity(10%)</p> </div> </div> </body> </html>
CSS backdrop-filter - sepia() Value
The following example demonstrates the use of backdrop-filter: sepia() property to add the sepia effect to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/red-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .sepia-box { background-color: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: sepia(90%); backdrop-filter: sepia(90%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: sepia() CSS Property</h1> <div class="background-img"> <div class="sepia-box"> <p>backdrop-filter: sepia(90%)</p> </div> </div> </body> </html>
CSS backdrop-filter - saturate() Value
The following example demonstrates the use of backdrop-filter: saturate() property to add the saturation effect to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/red-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .saturate-box { background-color: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: saturate(180%); backdrop-filter: saturate(180%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: saturate() CSS Property</h1> <div class="background-img"> <div class="saturate-box"> <p>backdrop-filter: saturate(180%)</p> </div> </div> </body> </html>
CSS backdrop-filter - Using Multiple Values
The following example demonstrates the use of backdrop-filter: blur() grayscale() property to add blur and grayscale effects to the backdrop of the element:
<html> <head> <style> .background-img { background: url(images/orange-flower.jpg) no-repeat center; background-size: cover; align-items: center; display: flex; justify-content: center; height: 400px; width: 400px; } .multi-box { background-color: rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: blur(2px) grayscale(70%); backdrop-filter: blur(2px) grayscale(70%); padding: 20px; margin: 30px; font-weight: bold; } </style> </head> <body> <h1>backdrop-filter: blur() grayscale() CSS Property</h1> <div class="background-img"> <div class="multi-box"> <p>backdrop-filter: blur(2px) grayscale(70%)</p> </div> </div> </body> </html>
To Continue Learning Please Login
Login with Google