CSS reveal on hover HTML content - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

CSS reveal on hover HTML content

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">
*, *:before, *:after {<!--from  w w  w .  jav  a2 s .  c om-->
   -moz-box-sizing:border-box;
   -webkit-box-sizing:border-box;
   box-sizing:border-box;
}

a {
   text-decoration:none;
   color:Chartreuse;
}

.block-icon {
   position:relative;
   display:block;
   width:100%;
   float:left;
   border:2px solid yellow;
   text-align:center;
   height:11em;
   margin-bottom:2em;
}

.block-icon .block {
   padding:.6em;
}

.block-icon .text-w {
   width:100%;
   height:100%;
   display:inline-block;
   vertical-align:middle;
   border:2px solid blue;
}

.block-icon .text-w:after {
   content:"\21";
   height:100%;
   display:inline-block;
   vertical-align:middle;
}

.top-stuff {
   position:absolute;
   top:0;
   left:0;
   width:100%;
   height:100%;
   background-color:pink;
   opacity:2;
   transition:opacity .4s linear;
}

.under-stuff {
   background-color:OrangeRed;
}

a:hover .top-stuff {
   opacity:0;
   transition:opacity .2s linear;
}

.button {
   border:2px solid grey;
}

@media (min-width: 500px)  {
   .block-icon {
      width:33%;
      margin-right:3%;
      margin-bottom:0;
   }
   
   .block-icon:nth-of-type(3) {
      margin-right:0;
   }

}
</style> 
 </head> 
 <body> 
  <a href="#" class="block-icon"> 
   <div class="block top-stuff"> 
    <div class="text-w">
      Lorem ipsum 
    </div> 
   </div> 
   <div class="block under-stuff"> 
    <div class="text-w"> 
     <h4>Lorem ipsum</h4> 
     <p>Lorem ipsum do</p> 
     <div class="button">
       Lorem ipsum dolo 
     </div> 
    </div> 
   </div> </a> 
  <a href="#" class="block-icon"> 
   <div class="block top-stuff"> 
    <div class="text-w">
      Lorem ipsum 
    </div> 
   </div> 
   <div class="block under-stuff"> 
    <div class="text-w"> 
     <h4>Lorem ipsum</h4> 
     <p>Lorem ipsum do</p> 
     <div class="button">
       Lorem ipsum dolo 
     </div> 
    </div> 
   </div> </a> 
  <a href="#" class="block-icon"> 
   <div class="block top-stuff"> 
    <div class="text-w">
      Lorem ipsum 
    </div> 
   </div> 
   <div class="block under-stuff"> 
    <div class="text-w"> 
     <h4>Lorem ipsum</h4> 
     <p>Lorem ipsum do</p> 
     <div class="button">
       Lorem ipsum dolo 
     </div> 
    </div> 
   </div> </a>  
 </body>
</html>

Related Tutorials