treehouse : what would you like to learn today?
Web Design Web Development iOS Development

4 column fluid layout

  • i am working on a new personal site, trying to create a fluid (4) column layout, where depending on the browser width the columns shift down. it is actually a similar layout to chris's old site (http://www.chriscoyier.net),...if you remember? no longer online. i have found a couple solutions using javascript, (http://fortes.com/projects/dynamiclayout/) but it seems like there has to be an cleaner way to achieve the effect.

    i appreciate any links you can forward me.
    thanks
    /trace
  • so it looks like it is much easier than i thought :shock:
    set a percentage width for each column , set a min-width..
    then let the float do it's magic.
    thanks chris!
    /trace'

    <body>
    <div class=\"column\">column 01</div>
    <div class=\"column\">column 02</div>
    <div class=\"column\">column 03</div>
    <div class=\"column\">column 04</div>
    <!-- clear the float after -->
    </body>


    .column {
    min-width: 200px;
    width: 24%;
    float: left;
    }