You seem to have implemented most things correctly but you have added borders to the 100% element making it 2px too tall and hence the scrollbar when none is needed.
As you aren’t using a background image then you can only make full length columns in the ways that we have shown you. I prefer the absolute column technique and added to your code would look like this.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="04_ThreeCol_Fixed_StickyFooter.css">
<style type="text/css">
html, body, h1, h2{
margin: 0;
padding: 0;
}
html, body {
height: 100%; /* Used to base height on. */
}
/* PAGE CONTAINER */
#wrapperLessFooter {
width: 930px;
min-height: 100%;
margin: 0 auto;
margin-top: -40px; /* Used to offset Footer height*/
background-color: #CCFFFF;
/* background:url(images/3colbackground.gif) repeat-y 0 0; /* Create the illusion of 3 columns with one background image. */
border: 1px solid #FFF;
border-top:none;
border-bottom:none;
position:relative;
}
* html #wrapperLessFooter { /* IE6 and under only. */
height:100%;
}
/* HEADER */
#header {
width: 100%;
color: white;
background-color: black;
border-top: 40px solid #000; /* Soaks up negative margin. Allows header to start at top of page. *//* background:blue; /*Cover up background image on #wrapper. */
position:relative;
z-index:2;
}
/* NAVIGATION */
#nav {
background-color: orange;
}
/* LEFT COLUMN */
#col1 {
float: left;
width: 150px;
min-height: 100px; /* In case of no content, prevents Floats from moving over to fill space. */
background-color: yellow;
position:relative;
z-index:2;
}
/* CENTER COLUMN */
#col2 {
float: left;
width: 630px;
min-height: 100px; /* In case of no content, prevents Floats from moving over to fill space. */
position:relative;
z-index:2;
}
/* RIGHT COLUMN */
#col3 {
float: right;
width: 150px;
min-height: 100px; /* In case of no content, prevents Floats from moving over to fill space. */
background: #D685AD;
position:relative;
z-index:2;
}
/* FOOTER */
#footer {
clear: both;
width: 930px;
height: 40px; /* Matches negative margin on wrapperLessFooter. */
margin: 0 auto;
background-color: gray;
}
/* OPERA FIX */
body:before {
float: left;
width: 0;
height: 100%;
margin-top: -32767px; /* Negates effect of float. */
content: "";
}
h1, h2, p {
padding: 0 10px; /* ?????? */
}
#wrapperLessFooter:after { /* Instead of using display table for IE8. */
clear: both;
display: block;
height: 1%;
content: " ";
}
/* absolute background overlay*/
#one,#three{
position:absolute;
top:0;
bottom:0;
width:150px;
clear:both;
}
#one{ background: yellow;left:0}
#three{ background: #D685AD;right:0}
/* ie6 fix*/
* html #one,* html #three {height:9999em;top:auto}
</style>
</head>
<body>
<div id="wrapperLessFooter">
<div id="header">
<h1>HEADER</h1>
<div id="nav"> NAVIGATION </div>
</div>
<div id="col1">COL1</div>
<div id="col2">
<h2>COL2</h2>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ipsum
felis, eleifend ut congue mattis, iaculis ac quam. Nam luctus
scelerisque felis, ac adipiscing metus facilisis in. Nullam et nisl
eu justo luctus sodales in varius arcu. Nunc enim leo, laoreet vitae
dapibus eget, malesuada nec erat. Nunc bibendum sapien vel lorem
laoreet lacinia. Vestibulum tortor elit, ultrices vitae luctus quis,
iaculis non libero. Quisque imperdiet tristique facilisis. Morbi
dictum, purus quis tempor malesuada, sem libero rhoncus ipsum, sed
gravida elit erat nec velit. Morbi feugiat sollicitudin ipsum luctus
pulvinar. Integer id nisi mi. Sed quis ligula sapien. In pulvinar
commodo arcu vel pellentesque. Quisque eu volutpat elit. Donec dui
tellus, consequat at dignissim et, ullamcorper sed enim. Vivamus et
est dui, ut sollicitudin sapien. Curabitur malesuada tellus eget diam
faucibus dapibus. Curabitur porta nulla ut quam bibendum quis auctor
sem elementum. Sed pretium sollicitudin tellus, eget vestibulum
lectus feugiat dapibus. Mauris vel velit vitae ligula auctor sagittis
vitae non augue. Praesent sit amet fermentum turpis. </p>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ipsum
felis, eleifend ut congue mattis, iaculis ac quam. Nam luctus
scelerisque felis, ac adipiscing metus facilisis in. Nullam et nisl
eu justo luctus sodales in varius arcu. Nunc enim leo, laoreet vitae
dapibus eget, malesuada nec erat. Nunc bibendum sapien vel lorem
laoreet lacinia. Vestibulum tortor elit, ultrices vitae luctus quis,
iaculis non libero. Quisque imperdiet tristique facilisis. Morbi
dictum, purus quis tempor malesuada, sem libero rhoncus ipsum, sed
gravida elit erat nec velit. Morbi feugiat sollicitudin ipsum luctus
pulvinar. Integer id nisi mi. Sed quis ligula sapien. In pulvinar
commodo arcu vel pellentesque. Quisque eu volutpat elit. Donec dui
tellus, consequat at dignissim et, ullamcorper sed enim. Vivamus et
est dui, ut sollicitudin sapien. Curabitur malesuada tellus eget diam
faucibus dapibus. Curabitur porta nulla ut quam bibendum quis auctor
sem elementum. Sed pretium sollicitudin tellus, eget vestibulum
lectus feugiat dapibus. Mauris vel velit vitae ligula auctor sagittis
vitae non augue. Praesent sit amet fermentum turpis. </p>
</div>
<div id="col3">COL3</div>
<!-- these elements just provide the background colour -->
<div id="one"></div>
<div id="three"></div>
</div>
<div id="footer">FOOTER</div>
</body>
</html>
The technique is explained in full in this article so you need to read it thoroughly. It uses an extra element that is placed absolutely over a column and can provide a full column colour because absolute elements can use top and bottom at the same time and match the height of the relative parent. Only absolute elements can do this.
In CSS you have one shot at 100% height and that’s because you can only use min-height:100% once. The wrapper element bases it’s min-height:100% on the 100% height we applied to html and body. You can only base a percentage min-height on an element that has a height defined. You cannot base a height on an element that is content height or has a percentage min-height. Read the faq on 100% height for more info as it is an important subject.
It’s like a catch 22 situation because you can instead use height:100% on the wrapper and that would allow you to further nest elements of 100% height. However setting height:100% means the element could never grow past the bottom of the viewport and content would just spill out.
As I said at the beginning you are better off keeping things simple from the start especially if you find these issues hard to digest to begin with. We could of course use the display:table properties to get the effect you want but as IE7 and under don’t understand it then it’s not worth the effort yet.
In CSS we usually let the content dictate the height. We let elements contract and grow as necessary unlike a table which keeps making all cells equal.