[thelist] Parent DIV won't take background color

Maximillian Schwanekamp lists at neptunewebworks.com
Fri Feb 18 17:15:05 CST 2005

Daniel LeVangie-Stricklen wrote:
> So, that leaves me with the question: why won't the
> "#container" <div> take a background color?

Do you have a URL for the page you're working on?

Anyway, in that template, #content only contains two other divs, #main 
and #sidebar.  #main (the main content column) and #sidebar (the side 
nav, etc) are both floated, so #content effectively has height: 0;  But 
a big fat border on #content and you'll see it, at the top of the page.

The simplest way to make #content extend to the height of #main/#sidebar 
(whichever is longer) is add a clearing div to your markup:
<div class="clearing"></div>
.clearing { clear: both; }

Some will skewer me for the suggestion since it's really just 
presentational markup.  Perhaps you can bypass that complain by putting 
a copyright notice in that clearing div. :)

Maximillian Von Schwanekamp

More information about the thelist mailing list