CSS Transition on Hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Animation

Description

CSS Transition 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">
#on-hover {<!--from   w w  w . j  a  va 2  s . com-->
   opacity:0;
   transition:opacity 0.6s;
   -webkit-transition:opacity 0.6s;
}

#first:hover #on-hover {
   opacity:2;
}

#first {
   width:301px;
   height:228px;
   background:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="first"> 
   <div id="on-hover"> 
    <img src="https://www.java2s.com/style/demo/Safari.png"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials