Forum Moderators: not2easy

Message Too Old, No Replies

wrapper background image cuts off

         

webguy262

12:03 pm on May 11, 2009 (gmt 0)

10+ Year Member



I have a wrapper around all the content of a page but the background image of the wrapper stops at the header unless I give it a height.

I want the background image to extend as far down as the actual content. Putting in the height makes the page extend beyond the content

<snip>

What am I missing?

[edited by: swa66 at 11:23 pm (utc) on May 11, 2009]
[edit reason] No personal URLs please see ToS [/edit]

swa66

11:27 pm on May 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Guess it's the typical why isn't my block element containing floated elements stretching to encompass them.

The answer is simple: it should not. The floats are not part of the flow. To make the parent stretch either float it itself, or add an element (such as a <br>) below it that has the cleat property on it, and is not floated itself (so it stays in the flow and get' force to sit below the floated element(s), effectively stretching the parent. Or alternatively google for "clearfix" to keep it all in the CSS (take care with hacks you might stumble upon).

webguy262

11:46 pm on May 11, 2009 (gmt 0)

10+ Year Member



perfect!