Make a two column layout's main div auto fit to browser width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

Make a two column layout's main div auto fit to browser width

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">

#sidebar{<!--from w  ww.j a v a2  s .  com-->
   float:left;
   width:230px;
   min-height:10px;
   overflow:hidden;
   margin:auto;
   background: #faa;
}
#content{
   min-height:10px;
   overflow:hidden;
   margin-left:230px;
   background:#cddfea;
}


      </style> 
 </head> 
 <body> 
  <div id="sidebar">
    aa 
  </div> 
  <div id="content">
    bb 
  </div>  
 </body>
</html>

Related Tutorials