1 reply [Last post]
Last seen: 14 years 45 weeks ago
Joined: 2008-01-18
Posts: 1
Points: 0


I imagine this must come up not infrequently, but a little searching through FAQs and previous postings didn't turn up anything; my apologies if this is an FAQ.

I'm not posting code/HTML because I think I just need someone to help me conceptually.

I've got a main window that I want to split into a variable-height header and then "the rest of the window". I want this "rest of window" container to stretch from the bottom of the header, wherever it is, to the bottom of the page, but not past it, regardless of its contents.

Is there a way to do this? I'm reasonably able with relative/fixed/absolute positioning and containers, but this one's eluding me. (I'm hoping it's something really obvious I've just missed for lack of coffee this morning).

Many thanks for help you can provide.


Chris..S's picture
Last seen: 10 years 10 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

You need to explain more.

You need to explain more. Why do you want the container to stretch, presumably its content won't stretch, but maybe its to do with background or borders?

CSS containers don't tend to stretch beyond their content requirements. You give the outer container the full height and then have the header sit over the top part of the outer container. The follow on content in the container just takes up the space it needs. If need be you structure your background graphics over the three (or more) elements to give the look that you are after. Positioning isn't used.