CSS hover recursively on all child elements - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

CSS hover recursively on all child elements

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">
.hoverdiv:hover * {<!--from w ww  . j a  v  a  2 s.  c o m-->
   background-color:Chartreuse;
}

.hoverdiv div {
   margin:6px;
}
</style> 
 </head> 
 <body> 
  <div class="hoverdiv"> 
   <div>
     Lorem 
   </div> 
   <div>
     Lorem 
   </div> 
   <div>
     Lorem i 
   </div> 
   <div>
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials