Display image and text inline and vertically centered - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Display image and text inline and vertically centered

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">
img {<!--  ww  w . j av  a  2 s.  c  om-->
   vertical-align:middle;
}

contactinfo-text {
   font-size:31px;
   color:Chartreuse;
   display:inline;
   margin-bottom:31px;
}

#contactinfo-text:hover {
   color:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="contactinfo-text"> 
   <img src="https://www.java2s.com/style/demo/Safari.png" height="60">Lorem ipsum dolor 
  </div>  
 </body>
</html>

Related Tutorials