Support Forum » CSS

3 Column liquid layout

(5 posts)
  • Started 3 years ago by thedrumdoctor
  • Latest reply from Edd

  1. thedrumdoctor
    Member

    Having spent my time getting the basics of CSS using fixed width layouts, I have now decided to try my luck at fighting browsers with liquid layouts. First off, I decided to opt for that 3 column liquid layout that I would have always resorted to Tables for in the past. Using the Style Master layout wizard, I ended up with the following "bare-bones" styling code to which I added a couple of minor tweaks:

    body {margin: 0;
    padding: 0;
    font-family: sans-serif;
    font-size: .7em;
    line-height: 1.4em;}

    div#header {padding: 2%;
    text-align: center;
    background-color: #ffffff;
    border-bottom: solid #ff0000 1px;}

    div#footer {padding: 2%;
    text-align: center;
    clear: both;
    background-color: #66cc33;}

    div#maincontent {padding: 2%;
    text-align: justify;
    margin-right: 30%;
    margin-left: 20%;
    background-color: #996600;}

    div#leftcolumn {
    padding: 0;
    float: left;
    text-align: left;
    background-color: #3399ff;
    width: 20%;
    }

    div#rightcolumn {padding: 0%;
    float: right;
    background-color: #9900ff;
    width: 30%;}

    The above styled the following HTML elements that the wizard generated:

    <body>

    <div id="header">This is the header</div>

    <div id="leftcolumn"> (left column) </div>
    <div id="rightcolumn"> (right column)</div>

    <div id="maincontent">
    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
    At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.
    Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    </div>

    <div id="footer">This is the footer</div>
    </body>

    Okay, not a bad skeleton to work with, though IE6 and Firefox do have their own whitespace display issues below the footer, which I can live with for now....HOwever, my main problem is trying to find a way to make the outer columns expand in height with the centre column. I've seen various methods employed using CSS positioning methods of varying skill levels, none of which, fall under the category of "newbie". Is there a basic method that I should be starting out with to try and achieve this within the markup that Style Master has generated for me in the above example?

    Posted: 3 years #
  2. Take a look at this tutorial at maxdesign.com:

    http://css.maxdesign.com.au/selectutorial/steps/step22.htm

    This might be what you are looking for and you can incorporate it into your CSS.

    Posted: 3 years #

  3. Posted: 3 years #
  4. thedrumdoctor
    Member

    Yes, that's the idea! Thanks, I frequent Russ' site quite frequently but didn't know about this section. I bought his book which has been and is very helpful, a great reference source. He does include a chapter on a 3 column liquid layout, but it uses 2 background images to assist with the appearance of the columns all stretching equally. I understand the the theory behind it but I lose the plot when it comes to working out how the percentage positioning values display the background images. It's easy to see the effect when dealing in pixel positioning but this percentage positioning is providing results that I wasn't expecting in the logical scheme of things. I could use a decent tutorial on this really if anyone knows....

    Posted: 3 years #
  5. I just ran across this very extensive list of 3 column layouts:
    http://css-discuss.incutio.com/?page=ThreeColumnLayouts

    Maybe there is something here to help.

    Posted: 3 years #

RSS feed for this topic

Reply

You must log in to post.

0.065 - 9 queries