Toggle visibility child on hover parent - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to Show

Description

Toggle visibility child on hover parent

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">
#name {<!--from w w  w .  j  av  a  2 s  . c  o m-->
   overflow:hidden;
   height:0;
   text-align:center;
   top:0;
   position:absolute;
   background-color:Chartreuse;
   color:yellow;
   width:301px;
   transition:3s;
}

#figure img:hover~#name {
   height:81px;
}
</style> 
 </head> 
 <body> 
  <div id="figure"> 
   <img src="https://www.java2s.com/style/demo/Opera.png"> 
   <div id="name">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials