I'd use Faux Columns to get both columns to extend to the footer whatever their content's length - basically, you just create a background image for the container and repeat it downwards.
To get the footer to sit at the bottom of the screen if there's not much content but move it to the bottom of the page if it's longer than the screen you shouldn't need to use any JavaScript - a little additional markup & CSS should do the trick:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing page</title>
<style type="text/css">
<!--
html {
height: 100%;
margin-bottom:1px;
}
body {
height: 100%;
margin: 0;
padding: 0;
text-align: center;
}
#container {
min-height: 100%;
height: auto;
margin: 0 auto -25px;
width: 770px;
background: #FF9 url(faux-columns.png) repeat-y;
text-align: left;
}
#header {
height: 75px;
background-color:#06F;
}
#green_bar {
width: 770px;
height: 20px;
background-color: #088A1C;
}
#ContentMain {
float:left;
width: 500px;
}
#ContentRight {
float: left;
width: 270px;
}
.push {
clear: both;
height: 25px;
}
#footer {
margin: 0 auto;
width: 770px;
height: 25px;
background-color: #99C;
text-align: left;
}
-->
</style>
<!--[if lte IE 6]>
<style type="text/css">
#container {height: 100%;}
</style>
<![endif]-->
</head>
<body>
<div id="container">
<div id="header"> Header </div>
<div id="green_bar"> Nav. bar </div>
<div id="ContentMain"> Main - should be on the left side. Next the right layer. </div>
<div id="ContentRight"> Right - should be on the right side, next to the Main layer.</div>
<div class="push"> </div>
</div>
<div id="footer"> This is the footer, always on the very bottom of the page. </div>
</body>
</html>
This ought to work in all of the following browsers:
Netscape 7
Firefox 2 & 3
Internet Explorer 5.5, 6 & 7
Opera 8 & 9
Safari 3
Working example: http://validcss.com/rappie
Bookmarks