Note: black bordered boxes are relative divs surrounding the examples.
Note: the numbers 1,2,3 are the order the divs come in the html. None of the numbered divs are nested.
Now here's the crucial point. Let's add a relative after the green float above. Where does it go? Try to think of the answer before you scroll down!
Did you say, 'it goes in the same place as the grey div in 'example 1'. If so give yourself a pat on the back. Don't believe that? Let's try.
Now let's look again at example 2 and add a second float: left. Where does it go?
Remember that a float will essentially go into the same position as a relative would. So there it goes! But there's already a float there, so by the axiom go as high as possible first, as left as possible next, we get this:
At this point, the question arises, "If a following Relative ignores those 2 Floats, how would I put something under the 2 green floats? The trick is to make a following Relative clear:both. This essentially tells the relative, "put me in a place where I can touch both sides without 'touching' anything else". Like this:
And from this we can see how to do the classic 2 column plus footer layout. The red line is clear: both, and in reality we'd make it height: 0, so it would be invisible.
3 Columns?? Easy now. Just look at Example 6 and throw 2 floats inside the float 2. This does have a problem in that you have a holding DIV that has no semantic meaning (the blue one) but, hey, I'm just the messenger, and that's the best we can't do right now IMO. Note when you look at the HTML how this has also let's us put the centre column first. Good for Google!
We have the problem of those floats' backgrounds. They don't extend down to the footer. What to do? The cool trick is to give the holding (black) div in Example 6, a background image that looks like this:
++++---------------------------
++++---------------------------
with the ++++ representing green say, and ------- representing blue, with this CSS:
background-image: url(/pics/faux-columns); background-repeat: repeat-y;
Running out of time here, so just go to http://www.simplebits.com to find out more about that.
See it in action at http://www.j-talk.com/
I've just thrown this up in a quiet 30 minutes on a Friday afternoon, so it has no design and no doubt it could be better, but if you have suggestions go to http://www.j-talk.com/gary/, and put a message on the message board.