Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 497473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:47:05+00:00 2026-05-13T05:47:05+00:00

I have a fixed-height (180px) header and fixed-height footer (50px). I’d like the container

  • 0

I have a fixed-height (180px) header and fixed-height footer (50px). I’d like the container height to be: window height MINUS header MINUS footer.

How do I achieve this using jQuery?

Edited to Add: If the container height is updated on window resize, that’d be awesome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:47:05+00:00Added an answer on May 13, 2026 at 5:47 am

    No need to use jquery.

    With css (i marked the key points to get it working, you can change the values accordingly):

    #header
    {
        top: 0;
        left: 0;
        width: 100%;
        height: 80px;          /* KEY POINT */
        overflow: hidden;
    }
    
    #footer
    {
        position: absolute;    /* KEY POINT */
        bottom: 0;
        left: 0;
        width: 100%;
        height: 36px;          /* KEY POINT */
        overflow: hidden;
    }
    
    #contents
    {
        position: fixed;       /* KEY POINT */
        top: 83px;             /* KEY POINT */
        left: 0;
        right: 0;
        bottom: 39px;          /* KEY POINT */
        right: 0;
        overflow: auto;
    }
    

    Results in something like:

    |----------------------------------------|
    |              div#header                |
    |            (80px height)               | 
    |----------------------------------------|
    |                                        |
    |              div#contents              |
    |         (top 83px, bottom 39px)        |
    |                                        |
    |----------------------------------------|
    |              div#footer                |
    |             (36px height)              |
    |----------------------------------------|
    

    This emulates old frames. In this example, there is a little span of 3px between each div.

    EDIT2:
    If you use some other absolute positioned divs (like tooltips), you have to add this condition to avoid a strange flickering in IE7:

    <!--[if IE 7]>
        <style type="text/css">
            #header
            {
                position: absolute;
            }
        </style>
    <![endif]-->
    

    EDIT3: seems like I didn’t paste the whole thing. This bit is essential to get it working with IE6. Please note this is not one of the usual expression’s hacks.

    * html body
    {
        /* YOU'LL RECOGNIZE THESE NUMBERS WITH THE EXAMPLE ABOVE */
        padding: 83px 0 39px 0;  
    }
    
    * html #contents
    {
        height: 100%;
        width: 100%;
    }
    

    Read here for more infos.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fixed-height (180px) header and fixed-height footer (50px). I'd like the container
Aim The aim is to a have a container DIV with a fixed height
I currently have a 2 column site layout, with a footer/header, a fixed width
Header, footer and sidebars have fixed position. In the center a content area with
I'm working on a fluid layout project. I have some fixed height DIVs in
I have a div element with fixed height and width and overflow:hidden, and I
Consider that we have a DIV with fixed height. Without a defined width ,
I wish to have a page that has a fixed height (without scroll bars).
Is it possible to have a UITableView that has a fixed height for all
If you have a parent div that wraps a fixed height div and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.