Image spin when hover over text - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Image

Description

Image spin when hover over text

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
span.red:hover {<!--  w w  w  .j  a va  2s  .  c  o m-->
   color:Chartreuse;
   -webkit-transition:color 0.6s ease-in;
   -moz-transition:color 0.6s ease-in;
   -o-transition:color 0.6s ease-in;
   transition:color 0.6s ease-in;
}

span.red:hover .star {
   -webkit-transform:rotate(46deg);
   -moz-transform:rotate(46deg);
   -0-transform:rotate(46deg);
   transform:rotate(46deg);
}

.star {
   -webkit-transition-duration:0.9s;
   -moz-transition-duration:0.9s;
   -o-transition-duration:0.9s;
   transition-duration:0.9s;
   -webkit-transform:rotate(0deg);
   -webkit-transition-property:-webkit-transform;
   -moz-transition-property:-moz-transform;
   -o-transition-property:-o-transform;
   transition-property:transform;
}

.star:hover {
   -webkit-transform:rotate(361deg);
   -moz-transform:rotate(361deg);
   -o-transform:rotate(361deg);
}

span.red {
   color:yellow;
   -webkit-transition:color 0.6s ease-in;
   -moz-transition:color 0.6s ease-in;
   -o-transition:color 0.6s ease-in;
   transition:color 0.6s ease-in;
}
</style> 
 </head> 
 <body> 
  <span class="red"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png" width="10" height="10" alt="star" class="star">Lorem ipsum dolor sit amet, consecte</span>  
 </body>
</html>

Related Tutorials