Just starting to learn and trying to use CSS rather than tables in my designs, which is proving to be a little challenging.

Stevie_D
—
2010-10-13T21:41:44Z —
#3

spiderling said:

I'm trying to apply a background color to the content block of a page, but it is not working. I've included the CSS and HTML below. Any thoughts why?

The only content of #containerl is floated. That means it is taken out of the document flow when laying out the elements. So, in terms of layout, #containerl has no content, and empty elements have no height.

The two easy ways round this are:1. Float #containerl2. Put overflow:hidden; on #containerl

Either of these methods will "enclose the float", so that #containerl will expand to go around (enclose) the whole of #content_left, and you'll see the background colour.