Fixed Column on Right, Fluid Column on the Left

This code produces a 2-column layout, with a fixed column to the right, and a column to the left that fills the remaining space. To change the width of the right column, just adjust anywhere in the code below that has 250px to match whatever width you want (someday we\'ll have variables in CSS!).

<style> 
       .left{ 
               float: left; 
               width: 100%; 
           } 
       .left_inner{ 
               background: red; 
               margin-right: 250px; 
           } 
       .right{ 
               background: yellow; 
               width: 250px; 
               float: right; 
               margin-left: -250px; 
            } 
       .clear{
               clear: both;
            }
</style> 

<div class=\"left\"> 
         <div class=\"left_inner\"> 
                 Left 
         </div> 
</div> 
<div class=\"right\"> 
          Right 
</div>
<div class=\"clear\"></div&g




Related Posts


Fixed Position Div Isn't Staying Fixed When Scrolling on Android

My nice fixed position toolbar wasn't sticking as it should as I scrolled through on my mobile browser window...
Read Post

Simple Sticky Element

The user scrolls down the page and once the scrolling reaches the top of an element of my choosing, that element sticks to the top of the window, so it's always visible from that point on...
Read Post

Chrome displays a different height than what Chrome says the height should be.

I was changing the height of an element, but no matter where I specified the height, it wasn't displaying what I was putting in
Read Post

A Nicer Select Dropdown

Better select boxes are all over the internet, but I actually couldn't find one that I liked, and that worked for what I needed...
Read Post