Add class on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover class

Description

Add class on hover

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">
.containerLeft {<!--   ww  w .j  a v  a  2 s .c om-->
   background-color:Chartreuse;
}

.containerRight {
   background-color:yellow;
}

.container:hover .containerLeft,
.container:hover .containerRight {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="containerLeft">
     Lorem 
   </div> 
   <div class="containerRight">
     Lorem i 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials