Vertically align image and text - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Alignment

Description

Vertically align image and text

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">
.wrapper {<!--from w w  w  . j a  v a 2  s  .  c  o m-->
   border:2px solid Chartreuse;
}

.to_the_left {
   float:left;
}

.clear {
   clear:both;
}

p.paragraph {
   padding-top:31px;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <img class="to_the_left" src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   <p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullam</p> 
   <div class="clear"></div> 
  </div>  
 </body>
</html>

Related Tutorials