Div show on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to Show

Description

Div show on hover

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">
.hover-state {<!--   w ww .  j a  va  2s. co  m-->
   position:absolute;
   padding:81px 51px;
   background-color:Chartreuse;
   width:251px;
   height:221px;
   top:20px;
   left:20px;
   cursor:pointer;
   display:none;
}

.portfolio a img {
   max-width:100%;
   max-height:100%;
   border-radius:4px;
   -moz-border-radius:4px;
   -webkit-border-radius:4px;
   transition:all 0.2;
   -moz-transition:all 0.2s;
   -webkit-transition:all 0.2s;
   display:block;
   margin:16px 0px;
   border:2px solid yellow;
   background-color:blue;
   padding:4px;
   -webkit-box-shadow:0 0 6px 0 pink;
}

.portfolio-item a:hover + .hover-state,
.hover-state:hover {
   display:block;
}

.portfolio-item {
   position:relative;
}
</style> 
 </head> 
 <body> 
  <div class="row portfolio"> 
   <div class="col-sm-6 col-md-3 portfolio-item"> 
    <a href="#"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </a> 
    <div class="hover-state"> 
     <p>Lorem</p> 
     <em>Lorem ip</em> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials