CSS filters and blend modes bring image-editing capabilities directly to the browser. The filter property applies graphical effects like blur, contrast, and hue rotation to an element. The backdrop-filter applies these effects to the area behind an element. Blend modes (mix-blend-mode and background-blend-mode) control how elements visually blend with what is underneath them.
These properties enable sophisticated visual effects without JavaScript or image assets — terminal scanlines, glitch effects, frosted glass, color adjustments, and more can be achieved purely with CSS.
/* Multiple filters can be chained — applied right to left */
4
}
Filter Functions
CSS provides ten filter functions that can be used individually or chained together. Each function accepts a parameter that controls the intensity of the effect.
Function
Parameters
Description
blur()
length (px, rem)
Applies Gaussian blur
brightness()
number or % (0-∞)
Linear multiplier (0=black, 1=normal, >1=brighter)
The backdrop-filter property applies filter effects to the area behind the element, creating effects like frosted glass. The element itself must be at least partially transparent for the effect to be visible.
backdrop-filter.css
CSS
1
.glass {
2
background: rgba(13, 13, 13, 0.6);
3
backdrop-filter: blur(12px);
4
-webkit-backdrop-filter: blur(12px); /* Safari support */
5
border: 1px solid rgba(255, 255, 255,0.1);
6
}
7
8
.glass-heavy {
9
background: rgba(26, 26, 46, 0.4);
10
backdrop-filter: blur(20px) saturate(1.5);
11
}
12
13
/* Frosted terminal panel */
14
.terminal-glass {
15
background: rgba(13, 13, 13, 0.7);
16
backdrop-filter: blur(8px);
17
border: 1px solid rgba(0,255, 65,0.1);
18
}
⚠
warning
backdrop-filter can be performance-intensive, especially with high blur values or on low-powered devices. Use values between 4px-12px for a good balance of visual quality and performance. Always include the -webkit- prefix for Safari.
Multiple Filters
Multiple filter functions can be chained in a single filter declaration, separated by spaces. They are applied in order from right to left. Chaining filters creates compound effects that cannot be achieved with a single function.
CSS supports two blend mode properties: mix-blend-mode blends an element with what is behind it, and background-blend-modeblends an element's background layers (images, gradients, colors) together.
mix-blend-mode: overlay; /* combines multiply and screen */
5
mix-blend-mode: difference; /* subtracts darker from lighter */
6
mix-blend-mode: exclusion; /* similar to difference but lower contrast */
7
}
8
9
.background-blend {
10
background:
11
linear-gradient(45deg, #00FF41, #0D0D0D),
12
url('bg.png');
13
background-blend-mode: overlay;
14
}
15
16
/* Terminal overlay blend */
17
.terminal-scanlines {
18
background: repeating-linear-gradient(
19
0deg,
20
transparent,
21
transparent 2px,
22
rgba(0, 255, 65, 0.03)2px,
23
rgba(0, 255, 65, 0.03)4px
24
);
25
mix-blend-mode: overlay;
26
pointer-events: none;
27
}
preview
mix-blend-mode
mix-blend-mode blends an element with its backdrop — the content behind it. It is commonly used for text overlays on images, creative hover effects, and terminal scanline overlays.
mix-blend-mode.css
CSS
1
.text-overlay {
2
mix-blend-mode: difference;
3
color: white;
4
/* Text appears inverted against any background */
5
}
6
7
.image-text {
8
mix-blend-mode: overlay;
9
color: #0D0D0D;
10
font-weight: 900;
11
/* Text blends with background image */
12
}
13
14
/* Available mix-blend-mode values */
15
/*
16
normal — no blending
17
multiply — multiplies pixel values (darker)
18
screen — inverse multiply (lighter)
19
overlay — combines multiply and screen
20
darken — uses darker pixel from each layer
21
lighten — uses lighter pixel from each layer
22
color-dodge — brightens backdrop
23
color-burn — darkens backdrop
24
hard-light — harsh lighting effect
25
soft-light — soft lighting effect
26
difference — subtracts darker from lighter
27
exclusion — similar to difference, lower contrast
28
hue — uses hue from element, saturation/luminosity from backdrop
29
saturation — uses saturation from element, hue/luminosity from backdrop
30
color — uses hue/saturation from element, luminosity from backdrop
31
luminosity — uses luminosity from element, hue/saturation from backdrop
32
*/
background-blend-mode
background-blend-modeblends an element's multiple background layers together. It does not affect blending with content outside the element. This is useful for creating textured backgrounds, gradient overlays, and terminal CRT effects.
background-blend-mode.css
CSS
1
.textured-bg {
2
background:
3
linear-gradient(135deg, #1A1A2E, #0D0D0D),
4
url('noise.png');
5
background-blend-mode: overlay;
6
}
7
8
/* Terminal CRT screen effect */
9
.crt-screen {
10
background:
11
radial-gradient(ellipse at center, rgba(0, 255, 65, 0.1) 0%, transparent 70%),