/    Sign up×
Community /Pin to ProfileBookmark

vertically stretch to fill page

I have a page that has:
Header
Navigation
Main content area
footer

i want it so that the main content area stretches to fill out the unused height in the page, so that the footer will always “hug” the bottom.

I tried setting the main area height to 100% but that just pushes the footer off the screen.
I also tried wrapping the page in a container div that had 100% height and width, but i’ve come to realise that divs do not inherit the parent div as tables do in html.

any help is appreciated

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@MoridinOct 26.2006 — I can't really give any specific tips without a link to the website and/or the code to see how it looks like. This might be useful for you though:

[url=http://blogs.msdn.com/danielmcpherson/archive/2004/06/17/158197.aspx]Point2Share: How to create a footer[/url]

  • - [b]Moridin[/b]
  • Copy linkTweet thisAlerts:
    @abzOct 26.2006 — I think you are after teh CSS property:

    vertical-align: bottom;
    Copy linkTweet thisAlerts:
    @KravvitzOct 26.2006 — No, vertical-align won't work for this. It only applies to inline-level elements and elements inside a table-cell.

    These are what the OP wants.

    [url=http://www.sitepoint.com/forums/showpost.php?p=1239966&postcount=3]How do you put a footer at the bottom of the window?[/url]

    [url=http://garyblue.port5.com/webdev/footertest.html]Lock the footer to the bottom of viewport[/url]
    Copy linkTweet thisAlerts:
    @IIIKrazyKiDDIIIOct 26.2006 — From my limited understanding of CSS, I believe it is not possible with CSS alone. You need to do javascript calculations.
    ×

    Success!

    Help @Sid3335 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.6,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...