
- CSS - Home
- CSS - Roadmap
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Types
- CSS - Measurement Units
- CSS - Selectors
- 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 - Cascading
- CSS - Universal Selectors
- CSS - ID Selectors
- CSS - Group Selectors
- CSS - Class Selectors
- CSS - Child Selectors
- CSS - Element Selectors
- CSS - Descendant Selectors
- CSS - General Sibling Selectors
- CSS - Adjacent Sibling Selectors
- 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 Advanced Features
- 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 Interview Questions
- CSS Online Quiz
- CSS Online Test
- CSS Mock Test
- CSS - Quick Guide
- CSS - Cheatsheet
- CSS - Properties References
- CSS - Functions References
- CSS - Color References
- CSS - Web Browser References
- CSS - Web Safe Fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - mix-blend-mode Property
CSS mix-blend-mode property determines how the content of an element should blend with the content of its parent and the element's background.
Syntax
mix-blend-mode: normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | difference | exclusion | hue | saturation | color | luminosity;
Property Values
Value | Description |
---|---|
normal | No blending occurs. |
multiply | It darkens colors by multiplying the background and foreground colors. |
screen | It lightens colors by inverting, multiplying, and inverting again. |
overlay | It combines multiply and screen, preserving highlights and shadows. |
darken | It retains the darker color from overlapping elements. |
lighten | It retains the lighter color from overlapping elements. |
color-dodge | It brightens the background by decreasing the color of the element. |
color-burn | It darkens the background by increasing the color of the element. |
difference | It subtracts the colors to create a high-contrast effect. |
exclusion | It is similar to difference, but with softer contrast effects. |
hue | It preserves luminance and saturation, altering only the hue. |
saturation | It Preserves luminance and hue, altering only the saturation. |
color | It combines hue and saturation of the element with luminance. |
luminosity | It preserves hue and saturation, altering only the luminosity. |
Examples of CSS Mix Blend Mode Property
The following examples explain the mix-blend-mode property with different values.
Mix Blend Mode Property with Normal Value
To prevent an element from interacting with other layers, we use the normal value. The element is rendered as is without any interaction with underlying layers. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: normal; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: normal </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Multiply Value
To multiply the background and foreground colors, resulting in a darker color, we use the multiply value. It results in rich shadows. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: multiply; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: multiply </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Screen Value
To brighten the colors by inverting both layers, multiplying them, and then inverting the result, we use the screen value. It produces a brightening effect. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: screen; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: screen </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Overlay Value
To enhances contrast by darkening dark areas and lightening light areas, we use the overlay value. It combines multiply and screen preserving highlights and shadows. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: overlay; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: overlay </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Darken Value
To compare the background and foreground colors, retaining the darker color, we use the darken value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: darken; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: darken </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Lighten Value
To retain the lighter color from overlapping elements, we use the lighten value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: lighten; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: lighten </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Color Dodge Value
To brighten the background by decreasing the foreground colors intensity, we use the color-dodge value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: color-dodge; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: color-dodge </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Color Burn Value
To darken the background by increasing the foreground colors intensity, we use the color-burn value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: color-burn; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: color-burn </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Difference Value
To subtract the colors of the overlapping layers, resulting in high-contrast effect, we use the difference value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: difference; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: difference </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Exclusion Value
To subtract the colors of the overlapping layers, resulting in a soft contrast effect, we use the exclusion value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: exclusion; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: exclusion </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Hue Value
To preserve the luminance and saturation of the background while altering only the hue of the element, we use the hue value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: hue; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: hue </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Saturation Value
To preserve luminance and hue, modifying only the saturation of the element, we use the saturation value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: saturation; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: saturation </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Color Value
To combine the hue and saturation of the element with the luminance of the background, we use the color value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: color; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: color </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Mix Blend Mode Property with Luminosity Value
To preserve the hue and saturation of the element, altering only the luminance, we use the luminosity value. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> .container { background-color: #6666ff; height: 300px; display: flex; justify-content: center; align-items: center; } .container>img { mix-blend-mode: luminosity; } </style> </head> <body> <h2> CSS mix-blend-mode property </h2> <h4> mix-blend-mode: luminosity </h4> <div class="container"> <img src="/css/images/content.png" alt="img" height=250 width=300/> </div> </body> </html>
Supported Browsers
Property | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
mix-blend-mode | 41.0 | 79.0 | 32.0 | 8.0 | 35.0 |