CSS filter Property
Applies graphical effects like blur and color shifting to an element
Syntax
filter: none | blur() | brightness() | contrast() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia() | url();Values
| Value | Description |
|---|---|
| none | No filter (default) |
| blur(4px) | Gaussian blur |
| brightness(1.2) | Increase brightness |
| contrast(1.5) | Increase contrast |
| grayscale(1) | Full grayscale |
| drop-shadow(2px 4px 6px rgba(0,0,0,0.3)) | Drop shadow |
| saturate(2) | Double saturation |
Example
.blurred-bg {
filter: blur(8px) brightness(0.7);
}
.thumbnail:hover {
filter: brightness(1.1);
}Understanding CSS filter
The CSS filter property applies graphical effects like blur and color shifting to an element. As part of the Filter & Effects module in CSS, it is one of the most commonly used properties for controlling the visual presentation of web pages.
You can set filter to values such as none, blur(4px), brightness(1.2), contrast(1.5), among others. Each value changes how the browser renders the affected element, giving you fine-grained control over your page layout and design. Choosing the right value depends on the specific design requirements of your project.
Common use cases for the filter property include responsive web design, component-based layouts, and creating visually consistent interfaces across devices. It works closely with related properties like backdrop-filter, opacity, mix-blend-mode to achieve complex styling effects. Understanding how these properties interact helps you write cleaner, more maintainable stylesheets.
Browser support for filter is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. For older browsers, consider using fallback values or progressive enhancement strategies. The property can also be set dynamically via JavaScript using element.style.filter or the CSS custom properties (variables) approach for theming.
Related Properties
backdrop-filterApplies graphical effects to the area behind an element for frosted-glass effects
opacitySets the transparency level of an element and its children
mix-blend-modeDefines how an element's content should blend with its background
box-shadowAdds one or more shadow effects to an element's frame
Explore More CSS Properties
Browse our complete reference of 251 CSS properties with syntax, examples, and tips.