CSS filter Property
Description
The filter property lets you apply one or more post-processing graphical effects to an element’s rendered output. Rather than changing an element’s layout box or the document structure, these effects operate on the element’s painted pixels — including its contents and background — producing a modified bitmap that is then composited into the page. Because the visual modifications happen after painting, using filter is a straightforward way to achieve photographic, color, or shadow-like transformations without altering DOM structure or text flow.
When a non-none filter is present the element is typically rendered into an intermediate image (an offscreen bitmap) before the filter operations are applied. That intermediate image is then used for blending and compositing; as a result, the property creates a new stacking context and can affect how the element interacts with other compositing operations. It’s important to note the distinction between this behavior and effects that apply to the backdrop behind an element — for that purpose see backdrop-filter. Also keep in mind that filters are applied before blend modes are evaluated, so they will alter the source image that properties like mix-blend-mode then blend with the page.
Multiple filter functions can be combined and their order matters: the list of functions is processed sequentially so swapping two functions can produce a different final appearance. Because filters generally rasterize the content, applying heavy or multiple filters can introduce softness or aliasing on vector content and may change text rendering quality. If you need strictly vector-preserved effects for SVG content, consider SVG-native filter primitives rather than CSS-level post-processing.
Performance-wise, filters can be both helpful and costly. Modern compositors often accelerate certain filter operations on the GPU, and applying a filter can promote an element to its own layer — which can be beneficial for isolated animations but may increase memory and compositing overhead. Animating expensive filter functions is often far heavier than animating transform or opacity; when possible prefer animating transform or opacity for smoother, less costly motion. If you do animate a filter, combine it with well-chosen timing controls such as transition or CSS animations and profile the impact on frame rate.
Finally, consider user experience and accessibility: dramatic filters can reduce legibility (for example, blurring or extreme contrast changes) and should not be used in ways that obscure essential content. Filters do not change the DOM or accessibility tree, so assistive technologies will still encounter the original document content, but visual users may experience reduced clarity. Also be mindful of overflow and hit-testing implications — because the filter is applied to a painted image, effects that extend outside an element’s original bounds (like a large drop shadow) can be clipped unless container overflow is adjusted.
Definition
- Initial value
- none
- Applies to
- All elements
- Inherited
- No
- Computed value
- As specified
- Animatable
- Yes
- JavaScript syntax
- object.style.filter
Interactive Demo
Syntax
filter: <filter-function> [<filter-function>]* | none
Values
- blur()Filter for blurring the image. The amount of blur is specified in pixels. If no number is specified, the default is 0.
- brightness()The function brightness() dims or brightens images or background pictures.
- contrast()The function contrast() decreases or increases the contrast of images or background pictures.
- drop-shadow()The function drop-shadow() adds shadow to images. In contrast to the property box-shadow, transparent areas in the image are taken into account and the shadow is cast taking them into account.
- grayscale()The function grayscale() turns the image into black and white.
- hue-rotate()The hue-rotate() function applies a hue rotation on the input image. The value of angle defines the number of degrees around the color circle the input samples will be adjusted.
- invert()The invert() function inverts the samples in the input image. The value of amount defines the proportion of the conversion. A value of 100% is completely inverted. A value of 0% leaves the input unchanged.
- opacity()The opacity() function applies transparency to the samples in the input image. The value of amount defines the proportion of the conversion. A value of 0% is completely transparent. A value of 100% leaves the input unchanged.
- saturate()The saturate() function saturates the input image. The value of amount defines the proportion of the conversion. A value of 0% is completely un-saturated. A value of 100% leaves the input unchanged.
- sepia()The sepia() function converts the input image to sepia. The value of amount defines the proportion of the conversion. A value of 100% is completely sepia. A value of 0% leaves the input unchanged.
- url()A CSS link to an SVG element with a specific #id.
Example
Browser Support
The following information will show you the current browser support for the CSS filter property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
