Do you want to be a good Web Developer?

Enter Your Email To Get Our Exclusive Tutorials
And Offer Right In Your Email

Join TalkersCode Community And Recieve Exclusive Tutorials
On Web Development Right Via Email.

Rotate And Flip Images Using CSS3

Monday, Jan 9, 2017

Tags:- CSS3 HTML


In this tutorial we will show you how to rotate and flip images using CSS3.You may also like Image Zoom In On Hover Using CSS3


See Demo
Rotate And Flip Image Using CSS3


To Rotate And Flip Images It Takes Only One Step:-

  1. Make a HTML file and define markup and styling Images


Step 1.Make a HTML file and define markup and styling Images

We make a HTML file and save it with a name images.html

<html>
<head>
<style>
body
{
 width:100%;
 margin:0 auto;
 padding:0px;
 background-color:#CEE3F6;
 font-family:helvetica;
}
#wrapper
{
 text-align:center;
 margin:0 auto;
 padding:0px;
 width:100%;
}
h1
{
 margin-top:50px;
 color:#2E9AFE;
}
h1 p
{
 font-size:14px;
 color:white;
}
img
{
 width:250px;
 margin:20px;
 -moz-transition: all 0.3s;
 -o-transition: all 0.3s;
 -webkit-transition: all 0.3s;
 transition: all 0.3s;
}
#img1:hover
{
 -moz-transform: rotate(180deg);
 -o-transform: rotate(180deg);
 -webkit-transform: rotate(180deg);
 transform: rotate(180deg);
}
#img2:hover
{
 -moz-transform: scaleX(-1);
 -o-transform: scaleX(-1);
 -webkit-transform: scaleX(-1);
 transform: scaleX(-1);
}
</style>
</head>
<body>
<div id="wrapper">
<img src="images/image1.jpg" id="img1">
<img src="images/image2.jpg" id="img2">
</div>
</body>
</html>

In this step we create two images one is for rotating effect and another is for flip effect.In our CSS we use CSS3 transform property to rotate and flip image. transform:rotate() is used to rotate the image and transform:scaleX is used to flip the image.You may also like Animated Login and SignUp Form With Flip Animation using CSS3 and jQuery


Thats all, this is how to Rotate And Flip Images Using CSS3 .You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.

Join Us With Our 21000+ Subscribers And Get Our Latest Tutorials Update Via Email