Forum Moderators: not2easy
Can this be done?
Thanks-
body {height: 100%;}
#content {position: absolute; left: 0; width: 70%;}
#nav {position: absolute; right: 0; width: 30%; height: 100%; background: #00f;}
#nav successfully spans 100% of the browser window. But, when your #content information exceeds the length of the browser window #nav will end...so the blue background will stop at that point. I'm wanting it to always take up the entire right hand 30% from top to bottom.
See what I mean? It might not be possible.
Another solution is having a white image repeat itself horizontally and vertically in the content box but have it positioned 30% off the left. That should work I think.
Bottom line, the solution lies in working with the background of the content box not of the navigation.
Thus, in your example, what you should do is:
body {background: #00f;}
#content {position: absolute; left: 0; width: 70%; background:white;}
#nav {position: absolute; right: 0; width: 30%;}
I don't think you need to construct an image. I don't think the "height" styles are needed either.
body { margin: 0; padding: 0; background: #00F; }
div#content { float: left; width: 70%; background: #FFF;}
div#nav { margin-left: 70%; font: bold 10px Verdana, sans-serif; color: #FFF;}
Another note is that if you don't have a padding set for these container elements that you'll get odd results in Mozilla once you fill them with content elements that has margins (specifically, if a container element doesn't have a padding set, then the margins of contained elements will be applied to the body element. Experiment to see what I mean.
A final note: if the nav is never longer than the content, you can take out the margin-left declaration in the div#nav element.
You'll also possibly notice that it is slightly buggy in MSIE in those cases in which the nav text is longer than the content.
This thing has to be solid in 5 &^ browsers absolutely. What about when the padding is set to zero?
It seems that positioning the <div>'s absolute instead of float will hold up stronger. Is that the general consensus at this point?