views:

76

answers:

3

Hi everyone, I am trying to construct a page layout, where the left column has a fixed width and a height of 100% (of whatever the right column is) and the right column has a fluid width. I've tried various ways of doing it, but can't seem to get it right..

Here's my code:

<div id="pageHolder">
  <div id="topSection">
    header goes here
  </div>
  <div id="pageContainer">
    <div id="leftColumn">
      <div id="leftHolder">
        left stuff goes here
      </div>
    </div>
    <div id="rightColumn">
      <div id="rightHolder">
        right stuff goes here
      </div>
    </div>
  </div>
  <div id="bottomSection">
    footer goes here
  </div>
</div>

And my css is:

body {
  height: 100%;
}
div#pageHolder {

}
div#topSection {
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
}
div#pageContainer {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
}
div#leftColumn {
  position: relative;   
  float: left;
  width: 285px;
  height: 100%;
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
}
div#leftHolder {
  padding: 25px 25px 25px 25px;
  margin: 0px 0px 0px 0px;
}
div#rightColumn {
  position: relative;   
  height: 100%;
  min-height: 100%;
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px 285px;
}
div#rightHolder {
  padding: 25px 25px 25px 25px;
  margin: 0px 0px 0px 0px;
}
div#bottomSection {
  clear: both;
}

If someone could help me out, that would be fantastic :)

+1  A: 

I believe you want to replace your body definition with body, html in your css, as well as add a height to pageHolder

body, html {
  height: 100%;
}
div#pageHolder {
  height: 100%;
}

It's pretty annoying though because you will get unnecessary scrollbars regardless of the content inside. Is this what you are trying to achieve?

theIV
Will add that, thanks.. But I'm trying to get the left column to be 100% height (depending on how much content is inside the right column), if that makes sense?
SoulieBaby
By 00% height (depending on how much content is inside the right column), you mean the same height as the right column, correct?
theIV
Yep, that's what I mean, sorry :)
SoulieBaby
Ah, well I'm glad Partial could be of help :) Cheers.
theIV
+3  A: 

Try this out:

div#leftColumn {
  position: absolute;   
  float: left;
  width: 285px;
  height: 100%;
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
}

**Edit: On second thought perhaps using maxwidth and maxheight could do something to help you if you want to keep position: relative.

Partial
Thanks so much, that worked, just needed to add left: 0px; :)
SoulieBaby
Glad I could help!
Partial
If you can, try it on different browsers just to make sure it works everywhere.
Partial
Internet Explorer tends to make odds stuff happen :S
Partial
+2  A: 

http://css-tricks.com/the-perfect-fluid-width-layout/

as i see the 'live example' this is what you're asking for

zalew