CSS hover a div how to display other class or div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover class

Description

CSS hover a div how to display other class or div

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">
.cover{ margin 0 auto;}
.cover .ab {<!--  w w w  . j  av  a2s.  c  om-->
   display:inline-block color:Chartreuse;
   height:26px;
}

.ac {
   position:absolute;
   top:-26px;
   height:26px;
}

.ab:hover~.ac {
   top:0px;
   height:26px;
}
</style> 
 </head> 
 <body> 
  <div class="cover"> 
   <div class="ab">
     Lorem i 
   </div> 
   <div class="ac">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials