Putting 2 divs side by side with image+text - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Putting 2 divs side by side with image+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">
.home2 {<!--from w  ww  .  j  a va  2  s.c  o m-->
   margin:0 auto;
   width:51%;
   text-align:center;
   display:table-cell;
   background-color:Chartreuse;
   height:401px;
}

.home2 p {
   font-family:'cabinRegular', arial, sans-serif, verdana;
   color:yellow;
   font-size:19px;
}

.center {
   display:table;
   margin:0 auto;
   width:100%;
   background-color:blue;
}

.home2_first img {
   margin:0 auto;
   padding:0;
}

.home2_second img {
   margin:0 auto;
   padding:0;
}
</style> 
 </head> 
 <body> 
  <div class="center"> 
   <div class="home2"> 
    <div class="home2_first"> 
     <img src="https://www.java2s.com/style/demo/Safari.png"> 
     <p>Lorem ipsum dolor sit amet, conse</p> 
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque</p> 
    </div> 
   </div> 
   <div class="home2"> 
    <div class="home2_second"> 
     <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
     <p>Lorem ipsum dolor sit amet, conse</p> 
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque</p> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials