The problem with xhmtl, css, and height, is that percentage heights refer to the percetange of the containing element. The parent element is "body". So, you have to give the body tag a height of 100%, as well as all child tags.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Yes, you're right.
You'll have to use JavaScript. Add this in your document head:
<script type="text/javascript">
//<![CDATA[
onload=function() {
document.getElementById('leftbar').style.height=
document.getElementById('rightbar').style.height=
document.getElementById('maincontent').offsetHeight+"px";
}
//]]>
</script>
This makes the style.height of your two side divs equal to the offsetHeight of your main div. It will run automatically "onload" (you don't have to modify your body tag), and will validate as xhtml (the CDATA comment sees to this).
Of course, you should remove the "height: 700px;" statements from your CSS.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
It should be cross-browser, though I admit I only tested with FireFox. I really don't use IE anymore.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37