Create 2 div columns, one fixed and one liquid - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

Create 2 div columns, one fixed and one liquid

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">
#container {<!--   ww w. j a  v  a2 s .  c o  m-->
   overflow:hidden;
   width:100%;
}

#mainCol {
   float:right;
   width:100%;
   margin:0 0 0 -201px;
}

#mainCol .inner {
   margin:0 0 0 201px;
   background:Chartreuse;
}

#sideCol {
   float:left;
   width:201px;
   background:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="mainCol"> 
    <div class="inner"> 
     <p>Some text</p> 
     <p>Some text</p> 
     <p>Some text</p> 
     <p>Some text</p> 
    </div> 
    <!-- .inner end --> 
   </div> 
   <!-- .mainCol end --> 
   <div id="sideCol"> 
    <p>Some text</p> 
    <p>Some text</p> 
    <p>Some text</p> 
    <p>Some text</p> 
   </div> 
   <!-- .sideCol end --> 
  </div> 
  <!-- #container end -->  
 </body>
</html>

Related Tutorials