align text and image vertical middle in div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Alignment

Description

align text and image vertical middle in div

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">
.rating {<!--from ww w.  j  av  a 2s  . c  o m-->
   border:2px solid Chartreuse;
   font-family:verdana;
   font-size:13px;
   width:181px;
   line-height:51px;
   height:51px;
}

span img {
   width:21px;
   height:21px;
   padding:0px 4px;
}
</style> 
 </head> 
 <body> 
  <div class="rating">
    Lorem ip 
   <span> <img src="https://www.java2s.com/style/demo/Opera.png">Lorem<img src="https://www.java2s.com/style/demo/Firefox.png">Lorem</span> 
  </div>  
 </body>
</html>

Related Tutorials