CSS: Adding gradient on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

CSS: Adding gradient on hover

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">
.blah {<!--from  ww  w  .j a v a  2 s.c o m-->
   background-color:Chartreuse;
   width:251px;
   height:251px;
}

.blah:hover {
   background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(yellow), to(blue));
   background-image:-webkit-linear-gradient(top, pink, OrangeRed);
   background-image:-moz-linear-gradient(top, grey, BlueViolet);
   background-image:-ms-linear-gradient(top, Chartreuse, yellow);
   background-image:-o-linear-gradient(top, blue, pink);
}
</style> 
 </head> 
 <body> 
  <div class="blah"> 
  </div>  
 </body>
</html>

Related Tutorials