Image-button with image caption - HTML CSS CSS Form

HTML CSS examples for CSS Form:input image button

Description

Image-button with image caption

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">

.thumbnail {<!--  w w  w  .j a  v  a 2 s.  c  om-->
   border-radius: 5px;
   border: 1px solid #ddd;
   display: inline-block;
   position: relative;
}
.thumbnail > figure {
   margin: 0;
   padding: 5px;
   position: relative;
   overflow: hidden;
}
.thumbnail > figure > figcaption {
   position: absolute;
   top:-200%;
   width: 100%;
   height: 100%;
   text-align: center;
   display: block;
   background-color: #eee;
   vertical-align: middle;
}
.thumbnail > figure > figcaption > div {
   line-height: 250px;
   font-size: 16px;
   color: #000;
}
.thumbnail:hover {
   background-color: #eee;
}
.thumbnail:hover > figure > figcaption {
   transition: top 0.5s ease-in;
   top: 0;
   background-color: rgba(238,238,238,0.4);
}


      </style> 
 </head> 
 <body> 
  <a href="#" class="thumbnail"> 
   <figure> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="bg"> 
    <figcaption> 
     <div>
       Caption here 
     </div> 
    </figcaption> 
   </figure> </a>  
 </body>
</html>

Related Tutorials