SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Belfast75's Avatar
    Join Date
    Oct 2005
    Location
    London, England
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy 3 Column layout. 2 fixed width, one fluid

    Hi,

    I'm trying to create a 3 column layout with the left and right column of fixed width and the middle fluid. There are plenty of examples of 3 column layouts either as fixed width or as fluid widths. Does any one have one with a combination of the two. I've spent most of today playing with it but with little success.

    I can get the first two columns to work but not the third!

    <style>
    #leftColumn {width:200px; background:#ff0; border:1px solid #000; float:left; position:relative;}
    #w880iRightContainer {border:3px solid green; margin-left:205px;}
    #centreColumn {background:#f0f; border:1px solid #000; margin-right:205px; float:left;}
    #rightColumn {width:200px; background:#0ff; border:1px solid #000; float:right;}

    </style>
    <div class="tabContent">
    <div id="leftColumn">
    <h1>leftcontent</h1>
    <p>#leftColumn</p>
    </div>

    <div id="centreColumn">
    <h1>centercontent</h1>
    <p>#centreColumn</p>
    </div>

    <div id="rightColumn">
    <h1>rightcontent</h1>
    <p>#rightColumn</p>
    </div>
    </div>


    Any help or suggestions, would be much appreciated!
    Cheers, Des

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your wanting the center column fluid?

    I am using this:

    * {
    font-size: 11px;
    font-family: Arial, Verdana, Helvetica;
    }
    body {
    margin: 10px 0px;
    padding:0px;
    background:#fff;
    }
    #leftcontent {
    position: absolute;
    left:10px;
    top:118px;
    width: 226px;
    /*border-left: 1px solid red;
    border-right: 1px solid red;*/
    }
    #centercontent {
    /* margin-left: 199px;
    margin-right:199px;*/
    margin-left: 231px;
    margin-right:199px;

    /*
    IE5x PC mis-implements the box model. Because of that we sometimes have
    to perform a little CSS trickery to get pixel-perfect display across browsers.
    The following bit of code was proposed by Tantek Celik, and it preys upon a CSS
    parsing bug in IE5x PC that will prematurly close a style rule when it runs
    into the string "\"}\"". After that string appears in a rule, then, we can override
    previously set attribute values and only browsers without the parse bug will
    recognize the new values. So any of the name-value pairs above this comment
    that we need to override for browsers with correct box-model implementations
    will be listed below.

    We use the voice-family property because it is likely to be used very infrequently,
    and where it is used it will be set on the body tag. So the second voice-family value
    of "inherit" will override our bogus "\"}\"" value and allow the proper value to
    cascade down from the body tag.

    The style rule immediately following this rule offers another chance for CSS2
    aware browsers to pick up the values meant for correct box-model implementations.
    It uses a CSS2 selector that will be ignored by IE5x PC.

    Read more at http://www.glish.com/css/hacks.asp
    */
    voice-family: "\"}\"";
    voice-family: inherit;
    /* margin-left: 201px;
    margin-right:201px;*/
    margin-left: 233px;
    margin-right:233px;
    }
    html>body #centercontent {
    /* margin-left: 201px;
    margin-right:201px;*/
    margin-left: 233px;
    margin-right:233px;
    }
    #rightcontent {
    position: absolute;
    right:10px;
    top:132px;
    width: 226px;
    /*border-left: 1px solid red;
    border-right: 1px solid red;*/
    }
    #banner {
    height:70px;
    voice-family: "\"}\"";
    voice-family: inherit;
    height:69px;
    margin-bottom: -22px;
    }
    html>body #banner {
    height:69px;
    }
    http://www.jojowebdesign.com
    "In the end, more is actually said, than done.."

  3. #3
    SitePoint Addict Belfast75's Avatar
    Join Date
    Oct 2005
    Location
    London, England
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah, yes. Probably would have helped to mention that!!

    left and right to be 200 px fixed width. Centre column to be fluid.

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah but the css I posted also has a top header..

    Something to play with. Also, visit the authors link.
    http://www.jojowebdesign.com
    "In the end, more is actually said, than done.."

  5. #5
    SitePoint Addict Belfast75's Avatar
    Join Date
    Oct 2005
    Location
    London, England
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers, works a treat.

    Many thanks for the help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •