π What Is mix-blend-mode?
The mix-blend-mode property controls how an elementβs content blends with the background or elements behind it, using blending formulas similar to Photoshop.
This enables beautiful visual effects like overlays, glowing text, artistic compositions, transparent layering, and advanced UI design. πβ¨
π§© Basic Syntax
Syntax
mix-blend-mode: normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | difference | exclusion | hue | saturation | color | luminosity;π― What mix-blend-mode Does
It blends the foreground layer (the element) with the background layerusing a mathematical formula defined by the chosen blend mode.
π All Blend Modes & What They Do
| Mode | Description |
|---|---|
| normal | No blending (default) |
| multiply | Darkens β colors multiply together |
| screen | Lightens β opposite of multiply |
| overlay | Mix of multiply + screen (high contrast) |
| darken | Keeps the darker pixel |
| lighten | Keeps the lighter pixel |
| color-dodge | Brightens background dramatically |
| color-burn | Burns/darkens background |
| difference | Subtracts colors β glowing effects |
| exclusion | Softer version of difference |
| hue | Uses foreground hue + background brightness |
| saturation | Uses foreground saturation |
| color | Foreground color + background luminance |
| luminosity | Foreground brightness on background color |
π§ͺ Basic Example
Blending text with background
h1 {
mix-blend-mode: overlay;
}β The text blends dynamically with the background image or gradient.
π¨ Example: Text Over Image
Overlay text effect
.title {
font-size: 4rem;
font-weight: 900;
mix-blend-mode: difference;
color: white;
}β Creates glowing, shifting contrast as the background changes.
π₯ Example: Multiply Effect
multiply example
.shape {
mix-blend-mode: multiply;
}β Used often in graphic design to darken overlapping elements naturally.
π Example: Neon Glow
neon effect
.neon {
color: #00f7ff;
mix-blend-mode: screen;
}β Creates a glowing bright text when placed over dark backgrounds.
π§ Example: Image Colorization
Colorize using blend-mode
.tint {
background: red;
mix-blend-mode: color;
}β Useful for tinting grayscale images.
π§ͺ Real UI Example: Button Hover Highlight
Button hover blend
button:hover {
mix-blend-mode: overlay;
}β Adds visual depth and shine on hover.
π¦ Example: Layered Shapes With Artistic Blending
Artistic layers
.circle {
width: 100px;
height: 100px;
background: magenta;
mix-blend-mode: lighten;
}β Layer multiple shapes for design-style visuals.
β οΈ Important Notes
- Blending works only when the element overlaps another element visually.
- Some elements may need position or z-index adjustments to blend properly.
- Results vary based on background content.
- Performance can be affected with large blended areas.
π¬ mix-blend-mode + filter = Amazing Effects
Blend + drop shadow
.logo {
filter: drop-shadow(0 0 10px cyan);
mix-blend-mode: screen;
}β Perfect for futuristic UI, gaming websites, sci-fi themes, etc.
π Debugging Tips
- If blending appears invisible β ensure the element overlaps something behind it.
- Try changing background color/texture for better effect.
- Avoid using on solid white backgrounds where blends do little.
- Use DevTools to toggle background layers while testing.
π Browser Support
- β Chrome
- β Edge
- β Firefox
- β Safari