Hide a div on hover outside of div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to Show

Description

Hide a div on hover outside of div

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">
#container {<!--  w  w w .j  av  a 2 s  . c  o m-->
   width:301px;
   height:301px;
   background:gray;
}

#animate {
   width:100px;
   height:100px;
   background:red;
   -webkit-transition:opacity 0.3s;
   -moz-transition:opacity 0.3s;
   transition:opacity 0.3s;
}

#container:hover #animate {
   opacity:0;
}

#container #animate:hover {
   opacity:2;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="animate"></div> 
  </div>  
 </body>
</html>

Related Tutorials