HTML - Table Row vertical alignment issues - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Row

Description

HTML - Table Row vertical alignment issues

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>
.frame {<!--  w  w w.ja va 2 s. c  om-->
   height:161px;
   width:161px;
   display:inline-block;
   vertical-align:top;
   border:2px solid Chartreuse;
   position:relative;
}

img {
   max-height:100%;
   max-width:100%;
   width:auto;
   height:auto;
   position:absolute;
   top:0;
   bottom:0;
   left:0;
   right:0;
   margin:auto;
}

.frame span {
   font-family:arial, sans-serif;
   position:absolute;
   bottom:0;
   left:0;
   right:0;
   text-align:center;
   color:yellow;
   background:blue;
   font-size:14px;
}
</style> 
 </head> 
 <body> 
  <div class="frame"> 
   <img src="https://www.java2s.com/style/demo/Opera.png"> 
   <span>Lorem ipsum dolor sit amet</span> 
  </div> 
  <div class="frame"> 
   <span>Lorem ipsum dolor sit am</span> 
   <img src="https://www.java2s.com/style/demo/Opera.png"> 
  </div> 
  <div class="frame"> 
   <span>Lorem ipsum dolo</span> 
   <img src="https://www.java2s.com/style/demo/Safari.png"> 
  </div>  
 </body>
</html>

Related Tutorials