Position text in the middle of each image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Position

Description

Position text in the middle of each image

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">
.about-big {<!--from  w  w  w. j ava 2 s .c om-->
   width:100%;
   height:auto;
   margin-top:81px;
   display:inline-block;
   overflow:hidden;
}

.about-big img {
   width:100%;
   max-height:801px;
   float:left;
}

.about-big1, .about-big2 {
   width:50%;
   position:relative;
   display:inline-block;
}

.overlay-text {
   text-align:center;
   position:absolute;
   top:0;
   right:0;
   bottom:0;
   left:0;
   height:201px;
   margin-top:51px;
   overflow:visible;
   margin:0 auto;
}

.overlay-text a {
   padding:21px 29px;
   border:5px solid Chartreuse;
   border-radius:5px;
   font-size:21px;
   text-decoration:none;
   display:inline-block;
   opacity:0.6;
   filter:alpha(opacity=51);
}
</style> 
 </head> 
 <body> 
  <div class="about-big"> 
   <div class="about-big1"> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="about"> 
    <div class="overlay-text"> 
     <a href="about.html" title="about"> <h3>Lore</h3> </a> 
    </div> 
   </div> 
   <div class="about-big2"> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt="about"> 
    <div class="overlay-text"> 
     <a href="about.html" title="about"> <h3>Lorem ipsum dol</h3> </a> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials