You want a blurred background behind a modal. Or a grayscale image that turns to color on hover. Or a slightly darkened hero image so the text on top is readable. In the past, you opened Photoshop, applied the effect, exported, uploaded, and repeated every time the design changed.
CSS filters do all of this in a single line of code. They apply visual effects at render time, so the original image stays untouched. Change the filter value and the effect updates instantly. No round-trip to an editor, no extra files to manage, and effects animate smoothly with CSS transitions.
The Filter Property and Its Functions
The CSS filter property accepts one or more filter functions. Each function takes a value that controls the intensity of the effect.
`css
.element {
filter: blur(4px) brightness(0.8) contrast(1.2);
}
`
The available filter functions:
- blur(px): Gaussian blur. Higher values = more blur.
blur(0)is no blur,blur(20px)is very blurry - brightness(%): Values above 100% brighten, below darken.
brightness(0%)is black,brightness(200%)is overexposed - contrast(%): Values above 100% increase contrast, below decrease it.
contrast(0%)is solid gray - grayscale(%):
grayscale(100%)is full black and white.grayscale(50%)is desaturated - sepia(%): Adds a warm brownish tone.
sepia(100%)is full sepia - saturate(%): Values above 100% increase color intensity.
saturate(0%)is the same as grayscale - hue-rotate(deg): Shifts all colors around the color wheel.
hue-rotate(180deg)creates a complementary color effect - invert(%):
invert(100%)creates a photographic negative - opacity(%): Same as the
opacityproperty but can be combined with other filters - drop-shadow(x y blur color): Similar to
box-shadowbut follows the shape of transparent images
Multiple filters are applied in order from left to right. The order matters: blur(4px) brightness(0.5) produces a different result than brightness(0.5) blur(4px) because blurring a dark image yields different results than darkening a blurred image.

Practical Effects You Can Use Today
Darkened hero image with readable text overlay:
`css
.hero-image {
filter: brightness(0.6);
}
`
This darkens the image by 40%, making white text on top easily readable. Adjust the value between 0.4 and 0.7 depending on the image.
Grayscale that turns to color on hover:
`css
.card-image {
filter: grayscale(100%);
transition: filter 0.3s ease;
}
.card-image:hover {
filter: grayscale(0%);
}
`
Great for portfolio grids, team photos, or client logos.
Frosted glass effect (glassmorphism):
`css
.glass-panel {
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
`
Note: this uses backdrop-filter, not filter. The blur applies to the content behind the element, not the element itself.
Disabled state for interactive elements:
`css
.disabled {
filter: grayscale(80%) opacity(50%);
pointer-events: none;
}
`
Image placeholder blur (while loading):
`css
.image-loading {
filter: blur(20px);
transition: filter 0.5s ease;
}
.image-loaded {
filter: blur(0);
}
`
This creates a smooth reveal effect when lazy-loaded images finish loading.
**Darkened hero image with readable text overlay:** ```css .hero-image { filter: brightness(0.6); } ``` This darkens the image by 40%, making white text on top easily readable.
Backdrop-Filter: Blurring What Is Behind
The filter property applies effects to the element and its children. The backdrop-filter property applies effects to the area behind the element. This distinction matters for overlays, modals, and navigation bars.
`css
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(8px);
}
`
This creates a semi-transparent overlay that blurs the content underneath, similar to what iOS and macOS use throughout their interfaces.
Common backdrop-filter patterns:
Sticky navigation bar:
`css
.navbar {
position: sticky;
top: 0;
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(10px) saturate(180%);
}
`
Tooltip with blur background:
`css
.tooltip {
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(6px);
color: white;
padding: 8px 12px;
border-radius: 6px;
}
`
Browser support for backdrop-filter is excellent in 2026. All modern browsers support it. The only consideration is performance: backdrop-filter can be GPU-intensive on complex pages with many overlapping elements. On mobile devices, use it sparingly or with smaller blur values.
Convert colors between formats using a Color Converter when you need rgba values for backdrop-filter backgrounds. The alpha channel (opacity) is critical for the blur effect to be visible.
Performance Considerations
CSS filters trigger GPU composition in most browsers, which means they are hardware-accelerated and generally performant. However, there are situations where they can cause issues:
Large blur values on large elements: Blurring a full-screen element with blur(30px) requires significant GPU memory. On lower-end devices, this can cause janky scrolling or dropped frames. Keep blur values under 15px for full-screen effects.
Animating filters: Transitioning between filter values is GPU-accelerated and smooth. But animating complex multi-function filters on many elements simultaneously can overwhelm the GPU. Limit animated filters to 2-3 elements at a time.
Stacking contexts: Any element with a filter value other than none creates a new stacking context. This means z-index behavior changes for that element and its children. If elements are disappearing behind others unexpectedly after adding a filter, this is likely the cause.
Print stylesheets: Filters may not render in print. Always reset filters in your print stylesheet: @media print { * { filter: none !important; } }
For images that always display with the same filter (like a permanently darkened hero), consider applying the effect to the image file itself using an Image Compressor and saving the processed version. This eliminates the runtime cost entirely.
Minify your CSS with a CSS Minifier after adding filter effects. Filter declarations with multiple functions can be verbose, and minification removes unnecessary whitespace.

Creative Filter Combinations
Single filters are useful. Combinations create distinctive visual styles:
Vintage photo effect:
`css
.vintage {
filter: sepia(60%) contrast(110%) brightness(90%) saturate(85%);
}
`
Dramatic high-contrast black and white:
`css
.dramatic-bw {
filter: grayscale(100%) contrast(150%) brightness(110%);
}
`
Dreamy glow:
`css
.dreamy {
filter: brightness(110%) contrast(90%) blur(1px) saturate(130%);
}
`
Night mode simulation:
`css
.night {
filter: brightness(60%) saturate(50%) hue-rotate(200deg);
}
`
Duotone effect (combine with blend modes):
`css
.duotone {
filter: grayscale(100%) contrast(120%);
mix-blend-mode: multiply;
}
`
These combinations work best when applied to images. Applying complex filters to UI elements like buttons or text can make them hard to read or interact with.
Experiment with hue-rotate() for fun brand variations. Rotating the hue by specific degrees can create cohesive color themes from a single image: rotate by 120 degrees three times and you get three complementary-colored versions of the same image.
SVG Filters: When CSS Is Not Enough
CSS filters cover the most common effects, but SVG filters give you unlimited creative control. You can reference an SVG filter from CSS:
`css
.custom-effect {
filter: url(#my-filter);
}
`
With the corresponding SVG:
`html
`
This creates a wavy distortion effect that is impossible with CSS filters alone. SVG filters can create glitch effects, realistic paper textures, water ripples, and other complex distortions.
The downside is complexity. SVG filter syntax is verbose and not intuitive. But for one-off creative effects, it is the most powerful tool available in the browser without JavaScript.
Some popular SVG filter effects:
- Noise/grain: adds film grain texture using feTurbulence
- Displacement: warps images based on a noise pattern
- Color matrix: precise control over individual color channels
- Morphology: erode or dilate shapes (useful for text effects)
For most day-to-day web development, CSS filters are sufficient. SVG filters are worth learning for creative projects, interactive art, and distinctive brand experiences.
CSS filters cover the most common effects, but SVG filters give you unlimited creative control.
FAQ
Do CSS filters affect accessibility?
They can. High contrast or brightness adjustments may make text unreadable for users with visual impairments. Grayscale effects remove color as a means of conveying information (red for errors, green for success). Always ensure that filtered content maintains sufficient contrast ratios (WCAG 2.1 requires 4.5:1 for normal text). Use the prefers-contrast and prefers-reduced-motion media queries to respect user preferences.
Can I animate CSS filters smoothly?
Yes. CSS filters are GPU-accelerated and animate smoothly with transition or @keyframes. The browser interpolates between filter values for smooth transitions. However, you cannot transition between different filter functions (e.g., from blur(4px) to grayscale(100%)). Both the start and end state must use the same filter functions in the same order.
Does filter affect the element's layout or size?
No. Filters are purely visual. They do not change the element's position, size, or box model. A blur(20px) effect extends visually beyond the element's bounds but does not push other elements away. If the blur bleeds into adjacent elements, use overflow: hidden on a parent container.
Is backdrop-filter supported in all browsers?
As of 2026, backdrop-filter is supported in all major browsers (Chrome, Firefox, Safari, Edge). Firefox added support in version 103 (mid-2022). The only concern is older browser versions. If you need to support very old browsers, provide a fallback with a solid semi-transparent background that degrades gracefully without the blur effect.
CSS Layout Tools: Grid, Flexbox, Gradients and Shadows
A practical guide to CSS Grid, Flexbox, gradients, and box shadows. Learn when to use each layout technique and generate clean CSS code fast.
Edit Images in Your Browser: Resize, Compress, Convert
Handle common image tasks in your browser without installing software. Resize, compress, convert formats, and inspect EXIF metadata in seconds.
CSS Generators: Gradients, Flexbox, Grid and Shadows
Use CSS generators to create gradients, flexbox layouts, grid systems, and box shadows. Visual editors output ready-to-copy CSS for your project.
