- Home
- /
- Tutorials
- /
- CSS Tutorial
- /
- Blending & Backdrop
CSS Effects
Blending & Backdrop
Blend overlapping content, isolate compositing groups, and filter the pixels behind translucent surfaces. It explains element blending, backdrop blending, isolation, translucent glass surfaces, unprefixed support, contrast, and rendering cost.
The frosted-glass panels you see in modern apps come from backdrop-filter: it blurs whatever is behind an element. Blend modes do something related, mixing an element's colors with the colors behind it, like layers in Photoshop.
Both effects depend on what is behind the element, so they look different on every background. That makes them fun for decoration and risky for text. This lesson builds on CSS Filters and CSS Opacity.
Blend an element with what is behind it
Example
css
.poster__title {
mix-blend-mode: screen;
}
.poster {
isolation: isolate;
}mix-blend-mode: screen mixes the title's colors with the poster image behind it, so the image shows through the letters. Other useful modes are multiply (darkens, good for removing white backgrounds from logos) and overlay. isolation: isolate on the parent keeps the blending inside the poster, and it starts a new stacking context.
Frosted glass with backdrop-filter
Example
css
.glass-panel {
background: rgb(255 255 255 / 0.72);
backdrop-filter: blur(12px) saturate(130%);
border: 1px solid rgb(255 255 255 / 0.55);
}The panel's own background is mostly white but slightly see-through, and backdrop-filter blurs everything behind it. The filter only shows through the transparent part, so a fully opaque background hides the effect completely.
Keep that background fairly solid anyway. If a browser does not support the filter, or the reader has turned off transparency effects, the text still needs to be readable on its own.
Compositing Properties
| Property | Purpose | Example |
|---|---|---|
| mix-blend-mode | Blends an element with the content behind it. | mix-blend-mode: multiply |
| background-blend-mode | Blends an element's background layers. | background-blend-mode: screen |
| backdrop-filter | Filters pixels behind a translucent element. | backdrop-filter: blur(12px) |
| isolation | Creates a separate stacking context for blending. | isolation: isolate |
Complete Example
Complete runnable example
html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blending & Backdrop example</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
padding: 2rem;
font-family: system-ui, sans-serif;
line-height: 1.5;
}
main { max-width: 70rem; margin-inline: auto; }
article, section, aside, form, .card, .panel {
padding: 1rem;
border: 1px solid #cbd5e1;
border-radius: 0.6rem;
}
.poster__title {
mix-blend-mode: screen;
}
.poster {
isolation: isolate;
}
.glass-panel {
background: rgb(255 255 255 / 0.72);
backdrop-filter: blur(12px) saturate(130%);
border: 1px solid rgb(255 255 255 / 0.55);
}
</style>
</head>
<body>
<main class="poster" style="padding:3rem;background:linear-gradient(135deg,#0f172a,#7c3aed)"><h1 class="poster__title">Blend mode</h1><section class="glass-panel"><p>Backdrop-filter blurs the pixels behind this panel.</p></section></main>
</body>
</html>Browser Support
Feature | Chrome | Edge | Firefox | Safari |
|---|---|---|---|---|
| mix-blend-mode | 41 | 79 | 32 | 8 |
| backdrop-filter, unprefixed | 76 | 79 | 103 | 18 |
Versions show the first stable desktop release with unprefixed support. Data source: MDN Browser Compatibility Data 8.0.8. A partial-support note is included where it changes how the example behaves.
Watch out for
- Text contrast. A blend mode can make text almost invisible on one part of an image and fine on another. Do not blend text people must read.
- Performance. Blurring a large area is heavy work. A big frosted header that moves on every scroll can make cheaper phones stutter. Keep blurred areas small and avoid animating them.
Blending & Backdrop exercises
Blend the card
Blend the card with what is behind it using multiply.
The HTML your code works on
<style>
.scene { background: linear-gradient(red, blue); padding: 20px; }
</style>
<div class="scene">
<div class="card">Card</div>
</div>Result
