center perfectly image and text inline in the center of page - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

center perfectly image and text inline in the center of page

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">
.footer {<!--from   w  w w  .j  a  v a 2  s .c om-->
   padding:11px;
   background:Chartreuse;
   text-align:center;
}

.footer img {
   vertical-align:middle;
}

.footer .text {
   margin-left:11px;
}
</style> 
 </head> 
 <body> 
  <div class="footer"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <span class="text">Lorem ipsum</span> 
  </div>  
 </body>
</html>

Related Tutorials