Hover on an <img> to make a new div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Image

Description

Hover on an <img> to make a new 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">
#logo {<!--   w  ww  .j av a  2s . c om-->
   position:absolute;
   z-index:2;
   left:0;
   top:0;
}

.logobody {
   position:absolute;
   z-index:3;
   left:0;
   top:0;
   background-color:Chartreuse;
   visibility:hidden;
   height:100%;
   width:100%;
}

#logo:hover .logobody {
   visibility:visible;
}

#bannerpic {
   max-width:770px;
   max-height:301px;
   width:100%;
   height:auto;
}
</style> 
 </head> 
 <body> 
  <div id="logo"> 
   <img id="bannerpic" src="https://www.java2s.com/style/demo/Safari.png"> 
   <div class="logobody">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials