Hover to expand right to left - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Hover to expand right to left

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">
.button {<!--from w w  w  .  j a v  a2  s  .  c  o m-->
   position:relative;
   width:41px;
   height:41px;
   float:right;
   background-color:Chartreuse;
   transition:margin-right 2s;
   z-index:1001;
}

.list {
   position:relative;
   width:100px;
   height:41px;
   float:right;
   margin-right:-100px;
   background-color:yellow;
   transition:margin-right 2s;
   z-index:100;
}

.button:hover + .list {
   margin-right:0px;
}
</style> 
 </head> 
 <body> 
  <div class="button"></div> 
  <div class="list"></div>  
 </body>
</html>

Related Tutorials