Hover to start animation to change text color - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Text

Description

Hover to start animation to change text color

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">

body {<!--   ww w  .  ja v  a 2 s  . c  om-->
   padding: 25px;
}
.text {
   color: blue;
}
.text:hover {
   -webkit-animation: color 1.0s ease-in forwards;
   -moz-animation: color 1.0s ease-in forwards;
   -o-animation: color 1.0s ease-in forwards;
   animation: color 1.0s ease-in forwards;
}
@-webkit-keyframes color {
   0%   { color: blue; }
   100% { color: red;  }
}
@-moz-keyframes color {
   0%   { color: blue; }
   100% { color: red;  }
}
@-o-keyframes color {
   0%   { color: blue; }
   100% { color: red;  }
}
@keyframes color {
   0%   { color: blue; }
   100% { color: red;  }
}


      </style> 
 </head> 
 <body> 
  <div class="text">
    Hover here 
  </div>  
 </body>
</html>

Related Tutorials