2/3 column float with footer layout. How to keep consistent length of columns?

Discussion in 'CSS' started by amnesia623, Mar 24, 2008.

  1. #1
    So I've always had a problem with this and haven't found any solutions except to go with an absolute position layout. Here's my issue:

    I like to use the traditional header, left column, right column, footer layout.

    If I use floats for the left/right columns, how can I keep the 2 columns the same length?
     
    amnesia623, Mar 24, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    Because IE doesn't support the display property to any great shakes, we use a work-around called faux columns to fake columns of apparent equal height.

    cheers,

    gary
     
    kk5st, Mar 24, 2008 IP
  3. amnesia623

    amnesia623 Active Member

    Messages:
    159
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #3
    hmm....thank you for this, I'll give it a shot!
     
    amnesia623, Mar 24, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Softnmore posted a neat idea here... one float wrapped the other. The length of the inner float forced the outer float to stay the same height.

    Like this:
    <div id="wrap">
    <div id="leftcolumn">
    <div id="rightcolumn>
    stuff stuff stuff
    </div>
    </div>
    </div>

    #wrap {
    width: 100%;
    overflow: hidden;
    }
    #leftcolumn {
    width: 100%;
    float: left;
    }
    #rightcolumn {
    width: 20%; (or whatever, and could be in px or anything)
    float: right;
    }

    It was a neat idea. The inner float has to be the one that will get longer... if the outer gets longer, the inner won't stretch to meet it. So, not foolproof.
     
    Stomme poes, Mar 25, 2008 IP