Hovering over one element animates another - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Hover

Description

Hovering over one element animates another

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

.outer {<!-- www .  j  a  va 2s.c om-->
   padding: 50px;
   width: 100px;
   height: 100px;
   background: black;
}
.inner {
   width: 100px;
   height: 100px;
   background: red;
}
.outer:hover .inner {
   background: green;
}
.inner:hover {
   background: red !important;
}


      </style> 
 </head> 
 <body> 
  <div class="outer"> 
   <div class="inner"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials