center text in the div horizontally with an image at left with vertical align middle - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Alignment

Description

center text in the div horizontally with an image at left with vertical align middle

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">
.designers ul {<!--   w w w .j  a va2  s .  c  om-->
   overflow:hidden;
   list-style:none
}

.designers li {
   border:2px solid Chartreuse;
   float:left;
   margin:11px;
   box-shadow:0 0 2px black;
   width:251px
}

.designers img {
   vertical-align:middle;
   width:71px;
   height:71px;
}

.designers span {
   width:171px;
   display:inline-block;
   vertical-align:middle;
   text-align:center;
   font-size:17px;
   font-family:Open Sans;
   font-weight:bold;
}
</style> 
 </head> 
 <body> 
  <div class="designers"> 
   <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra,</p> 
   <ul> 
    <li> <img alt="" src="https://www.java2s.com/style/demo/Google-Chrome.png"> <span>Lorem ipsum dolo</span> </li> 
    <li> <img alt="" src="https://www.java2s.com/style/demo/Firefox.png"> <span>Lorem ipsu</span> </li> 
    <li> <img alt="" src="https://www.java2s.com/style/demo/Safari.png"> <span>Lorem ipsum</span> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials