have image and text side by side - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

have image and text side by side

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">
.iconDetails {<!--from   w  w  w .  j a v  a2  s  .  c o  m-->
   margin-left:3%;
   float:left;
   height:41px;
   width:41px;
}

.container2 {
   width:100%;
   height:auto;
   padding:2%;
}

h4 {
   margin:0px;
}
</style> 
 </head> 
 <body> 
  <div class="container2"> 
   <div> 
    <img src="https://www.java2s.com/style/demo/Opera.png" class="iconDetails"> 
   </div> 
   <div style="margin-left:60px;"> 
    <h4>Lorem ip</h4> 
    <div style="font-size:.6em">
      Lorem ipsum dolor sit amet, consectet 
    </div> 
    <div style="float:right;font-size:.6em">
      Lorem ipsum 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials