3 column layout with fixed middle, but not the 50% solution?

Discussion in 'CSS' started by 123GoToAndPlay, Dec 10, 2010.

  1. #1
    Hi,

    I am updating an exicting page and i like to have a 3 column layout with a fixed middle column.
    I tried this, but the right colum and left don't start or end at the middle column? i need this so i can alter the z-index.

    #content { 
    width: 800px;
    height: 750px;
    margin: 0 auto;
    text-align: left;
    background: #CCCCCC;
    overflow:auto;
    } 
    
    .column { 
    width: 50%; 
    position: absolute; 
    top: 0; 
    } 
    
    .left {left: 0;} 
    .right {right: 0;} 
    
    #leftcol {
    margin-right: 400px; 
    background: #0099FF;
    height: 750px;
    
    } 
    #rightcol {
    margin-left: 399px;
    background: #0099FF;
    height: 750px;
    }  
    Code (markup):
    Anyway to have the left and right column just with
    
    #leftcol {
    width: whatever-is-left-over-on-the-left-side;
    }
    #rightcol {
    width: whatever-is-left-over-on-the-right-side;
    }
    
    Code (markup):
    Any suggestions?
     
    123GoToAndPlay, Dec 10, 2010 IP
  2. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #2
    CSM, Dec 10, 2010 IP
  3. nadeem3366

    nadeem3366 Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Hi,

    I think you have to specify the middle colum with in px like 600px;

    and why are you defining the left and right margins for right and left colums so high?

    if you specify with for all columns in px, i am sure it will be fixed forever.
     
    nadeem3366, Dec 13, 2010 IP