
- 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
How to add visual effects to images with CSS?
Following is the code to add visual effects to images with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> img{ margin: 20px; } img.normal{ margin-left: 30%; width: 300px; height: 300px; } img.filter { width: 300px; height: 300px; filter: invert(100%); } </style> </head> <body> <h1 style="text-align: center;">CSS Image effects 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
- Add shadow effects to text with CSS
- Add shadow effects to elements with CSS
- How to style images with CSS?
- Add style to images with Bootstrap
- How to Add Cinematic Effects On Selfies
- How to create image overlay hover slide effects with CSS?
- How to change background images on scroll with CSS?
- How to align images side by side with CSS?
- How to create rounded and circular images with CSS?
- Understanding CSS Visual Formatting
- CSS Visual Formatting Model
- How to create responsive Modal Images with CSS and JavaScript?
- How to create Border Images in CSS
- Is it possible to add HTML5 validation to Visual Studio?
- Animation Effects in CSS
Advertisements