- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 flip an image (add a mirror effect) with CSS?
Following is the code to flip and image using CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> img:hover { transform: scaleX(-1); width: 400; height: 400; } </style> </head> <body> <h1>Flipping an Image Example</h1> <img src="https://i.picsum.photos/id/551/400/400.jpg"> <h1>Hover over the above image to see it mirrored</h1> </body> </html>
Output
The above code will produce the following output −
On hovering the image the image will be mirrored as follows −
- Related Articles
- Flip Effect with CSS
- Flip Animation Effect with CSS
- Flip an image on mouse over with CSS
- Flip In X Animation Effect with CSS
- Flip In Y Animation Effect with CSS
- Flip Out X Animation Effect with CSS
- Flip Out Y Animation Effect with CSS
- How to add a border to an image with CSS?
- How to add a button to an image with CSS?
- How to add a navigation menu on an image with CSS?
- How to create an image overlay zoom effect on hover with CSS?
- Create a mirror image with CSS
- How to create image overlay hover effect with CSS?
- Add a blur effect to the shadow with CSS
- How to create a flip card with CSS?

Advertisements