Hover to change all children element - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Hover to change all children element

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 .left {
   width:21px;
   height:100px;
   background:Chartreuse;
   float:left;
}

.button .middle {
   width:21px;
   height:100px;
   background:yellow;
   float:left;
}

.button .right {
   width:21px;
   height:100px;
   background:blue;
   float:left;
}

.button:hover .left {
   background:pink;
}

.button:hover .middle {
   background:OrangeRed;
}

.button:hover .right {
   background:grey;
}
</style> <!--from ww w. j  av a  2s .c om-->
 </head> 
 <body> 
  <div class="button"> 
   <div class="left"></div> 
   <div class="middle"></div> 
   <div class="right"></div> 
  </div>  
 </body>
</html>

Related Tutorials