On hover: Move div up, on top of sibling - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover on list

Description

On hover: Move div up, on top of sibling

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:hover .bottom {
   top:-401px;
}

.bottom {
   position:relative;
   top:0px;
   transition-property:top;
   transition-duration:2s;
}
</style> <!--from   w w w .  j  av a  2 s .  c  o  m-->
 </head> 
 <body> 
  <div class="container" style="height:400px !important; width:100% !important; overflow:hidden;"> 
   <div class="top" style="height:400px !important; width:100% !important; background-color: red;"> 
   </div> 
   <div class="bottom" style="height:400px !important; width:100% !important; background-color: blue;"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials