position text under two images - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Position

Description

position text under two images

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
#officers {<!--from w w w  . ja  v a2 s.c  om-->
   width:555px;
}

.officer {
   width:268px;
   position:relative;
   float:left;
   text-align:center;
   margin:4px 11px 4px 0;
}
</style> 
 </head> 
 <body> 
  <div id="officers"> 
   <div class="officer"> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="Captain"> 
    <span class="caption">Lorem ipsum dolor s</span> 
   </div> 
   <div class="officer"> 
    <img src="https://www.java2s.com/style/demo/Firefox.png" alt="President"> 
    <span class="caption">Lorem ipsum dolor sit a</span> 
   </div> 
   <div class="officer"> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt="Lady Captain"> 
    <span class="caption">Lorem ipsum dolor sit amet, </span> 
   </div> 
   <div class="officer"> 
    <img src="https://www.java2s.com/style/demo/Safari.png" alt="Junior Captain"> 
    <span class="caption">Lorem ipsum dolor sit amet, co</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials