Hover over div's nested items - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

Hover over div's nested items

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">
.parent .content2 {<!--   ww  w  . j  a va2  s. com-->
   display:none;
}

.parent:hover .content1 {
   display:none;
}

.parent:hover .content2 {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="content1">
     Lorem ipsum dolor si 
   </div> 
   <div class="content2"> 
    <div class="annoyingdiv">
      Lorem ipsum dolor sit a 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials