Align divs side by side - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Div Align

Description

Align divs 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">
#bottom-content {
   border:2px solid Chartreuse;
   overflow:hidden;
   text-align:left;
}

#left-desc, #description-space {
   display:inline-block;
   -webkit-box-sizing:border-box;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
   min-height:401px;
}

#left-desc {
   border:2px solid yellow;
   float:left;
   width:51%;
   overflow:hidden;
}

#description-space {<!--   w  w w  .  java 2s . c  om-->
   border:2px solid blue;
   float:right;
   width:51%;
   overflow:hidden;
}
</style> 
 </head> 
 <body> 
  <div id="bottom-content"> 
   <div id="left-desc"> 
   </div> 
   <div id="description-space"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials