CSS: Centre image and text vertically in a div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

CSS: Centre image and text vertically in a div

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!-- w w  w.  j av a 2s. c om-->
 <body> 
  <div> 
   <img style="padding: 10px 0px 10px 10px; vertical-align:middle" src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
   <h1 style="font-size:25px; display:inline-block;">Lorem ips</h1> 
  </div>  
 </body>
</html>

Related Tutorials