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 6554655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:43:34+00:00 2026-05-25T12:43:34+00:00

How can I set an html element to have a 100% height on a

  • 0

How can I set an html element to have a 100% height on a page that has a fixed height header? The layout is, of course, not fixed height.

I already have the html and body set to simulate min-height: 100% correctly.


I have tried the following ideas, but to no avail:

1. I have used the following CSS, but it uses a percentage-based height, which doesn’t work well because my layout’s header is a fixed 81px in height.

#divContent
{
    height: 82%;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 82px;
    width: 950px;
}

2. I have used the following in various combinations of the padding and margin, but all of them expand the height of the page (which is hidden), thereby making them all look the same: the bottom 81px are hidden.

html, body
{
    overflow: hidden;
    margin-bottom: 82px;
    padding-bottom: 82px;
}
#divContent
{
    height: 100%;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 82px;
    width: 950px;
    margin-bottom: 82px;
    padding-bottom: 82px;
}

I want my divContent to consume all of the body’s height minus 81px.

I know how I could immediately do it using tables, but that would be improper use of tables. I also figure that it could be automatically calculated using jQuery, but I haven’t written jQuery like that before.

P.S. I have looked through about a dozen questions and cannot find a solution. If you can prove this is a duplicate that actually covers the same issue, I would gladly read that other post.

  • 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-25T12:43:34+00:00Added an answer on May 25, 2026 at 12:43 pm

    Set the bottom of the div to 0px. This will expand the div to consume the rest of the page

    #divContent
    {
    
        margin: 0;
        padding: 0;
        position: absolute;
        top: 82px;
        bottom: 0px;   
        width: 950px;
    }
    

    Here is a very similar question I answered a while back

    How to build this layout with CSS?

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

Sidebar

Related Questions

How can I determine the explicit width of a HTML element that has width
I have an HTML element which is set as position: fixed in the CSS.
How can I set the background color of an HTML element using css in
I wanted to set a top header in a fixed position and have content
When you have an HTML element with no class name set, what is the
Situation: I have a function that dumps input data into an HTML block element,
I have an HTML element whose background colour is set with rgba() <div style=background-color:
how can I set embed parameters for html wrapper using Flex Builder ? For
I want to display a children element of my html page all over the
I have this simple project to grab HTML element inner data. This is 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.