Text with Transparent Background in front of an image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Text with Transparent Background in front of an 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">
* {<!--   ww  w .  j  ava 2s.  c  o m-->
   padding:0;
   margin:0;
}

#articlebottom {
   width:981px;
   height:301px;
}

.products {
   width:981px;
   margin:0px auto;
   padding-left:21px;
}

#articlebottom .imgWrap {
   width:296px;
   height:201px;
   position:relative;
   float:left;
   margin:11px;
   border:6px solid Chartreuse;
}

#articlebottom .imgWrap img {
   width:100%;
   height:100%;
}

#articlebottom .imgDescription {
   position:absolute;
   top:36px;
   left:0;
   letter-spacing:3px;
   background-color:yellow;
   color:blue;
   font-weight:bold;
   font-size:19pt;
   width:100%;
   height:51px;
   opacity:2;
   text-align:center;
   visibility:hidden;
   opacity:100;
   text-transform:uppercase;
}

#articlebottom .imgWrap:hover .imgDescription {
   visibility:visible;
}
</style> 
 </head> 
 <body> 
  <article id="articlebottom"> 
   <div class="products"> 
    <div class="imgWrap"> 
     <img src="https://www.java2s.com/style/demo/Firefox.png" alt="candle"> 
     <p class="imgDescription">Lorem i</p> 
    </div> 
    <div class="imgWrap"> 
     <img src="https://www.java2s.com/style/demo/Safari.png" alt="candle"> 
     <p class="imgDescription">Lorem i</p> 
    </div> 
    <div class="imgWrap"> 
     <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="candle"> 
     <p class="imgDescription">Lorem i</p> 
    </div> 
   </div> 
  </article>  
 </body>
</html>

Related Tutorials