CSS Filters
CSS filters allow us to apply various visual effects to images and other elements. These effects bring functions familiar from graphic editors to the web, such as blur, grayscale, or shadows.
Basics of the filter property
The <filter> property in CSS enables visual effects such as blur, brightness, or contrast. These can also be chained, allowing multiple effects to be applied at once.
Filtering images
Filters are most commonly used on images, for example to make them grayscale, blurred, or tinted. This is especially useful for design highlights or hover effects.
Code Details
<img src="https://placehold.co/200x100/png" style="filter: grayscale(100%);">
<img src="https://placehold.co/200x100/png" style="filter: blur(5px);">
Preview
Shadows and special effects
The drop-shadow filter is particularly popular because it creates a natural shadow effect. Compared to traditional box-shadow, a filter shadow better follows the transparency of an image.
Tips for using filters
Filters are powerful tools, but attention must be paid to performance and user experience.
- Avoid combining too many filters, as it can slow down the page.
- Use hover effects with filters for visual emphasis.
- Test effects across different browsers, as differences may occur.
✨ Ask Lara — your AI study partner
Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.
Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.


