
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Working with CSS3 Filter Effects
To set Filter Effects in CSS3, use the filter property. Following filter effects can be set −
blur() | brightness() | contrast() | grayscale() | invert() | opacity() | saturate() | url();
Following is the code for using filter effects in CSS3 −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> img{ margin: 20px; width: 200px; height: 200px; } img.normal{ margin-left: 30%; } img.filter { filter: invert(100%); } </style> </head> <body> <h1 style="text-align: center;">CSS3 Filter effect example</h1> <img class="normal" src="https://i.picsum.photos/id/237/536/354.jpg"> <img class="filter" src="https://i.picsum.photos/id/237/536/354.jpg"> </body> </html>
Output
The above code will produce the following output −
- Related Questions & Answers
- Working with CSS3 2D Transform Functions
- Working with CSS3 3D Transform Functions
- How to create CSS3 Transition Effects?
- Understanding the CSS3 Filter Functions
- Effects of Undersampling (Aliasing) and Anti-Aliasing Filter
- How to create CSS3 Box and Text Shadow Effects?
- Media queries with CSS3
- Filter array with filter() and includes() in JavaScript
- Extending User Interface with CSS3
- Adding Multiple Backgrounds with CSS3
- Add shadow effects to text with CSS
- Add shadow effects to elements with CSS
- Shadow Filter with CSS
- Filter table with Bootstrap
- HTML5 SVG css3 transition on fill not working when there is external link
Advertisements