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

  • Home
  • SEARCH
  • 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 7893515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:09:09+00:00 2026-06-03T07:09:09+00:00

I have a page that has a header, content, and footer. The header and

  • 0

I have a page that has a header, content, and footer. The header and footer are of fixed height, and I’d like the content to adjust its height so that it fits dynamically between the header and footer. I am planning to put a background-image in my content, so it is critical that it actually fills the rest of the unoccupied vertical space.

I used the Sticky Footer approach to ensure that the footer remains on the bottom of the page. This however does not make the content span the entire height of the remaining space.

I have tried several solutions which involved me adding height:100%, height:auto; position:relative but it did not work.

html,
body {
  height: 100%;
  background-color: yellow;
}
header {
  width: 100%;
  height: 150px;
  background-color: blue;
}
header nav ul li {
  display: inline;
  padding: 0 30px 0 0;
  float: left;
}
#wrapper {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  margin: 0 0 -30px 0;
  /* the bottom margin is the negative value of the footer's height */
  position: relative;
}
#wrapper #content {
  background-color: pink;
  width: 400px;
  height: 100%;
  margin: 0 0 -30px 100px;
  padding: 25px 30px 25px 30px;
}
footer {
  margin: -30px 0 0 0;
  width: 100%;
  height: 30px;
  background-color: green;
}
<div id="wrapper">

  <header>
    <div id="logo"></div>

    <nav>
      <ul>
        <li>About</li>
        <li>Menu</li>
        <li>Specials</li>
      </ul>
    </nav>
  </header>

  <div id="content">
    content
    <br>goes
    <br>here
  </div>

</div>

<footer>footer</footer>
  • 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-06-03T07:09:10+00:00Added an answer on June 3, 2026 at 7:09 am

    Try changing your css to this:

    html,
    body {
      height: 100%;
      background-color: yellow;
    }
    header {
      width: 100%;
      height: 150px;
      background-color: blue;
    }
    header nav ul li {
      display: inline;
      padding: 0 30px 0 0;
      float: left;
    }
    #wrapper {
      min-height: 100%;
      height: auto !important;
      height: 100%;
      margin: 0 0 -30px 0;
      /* the bottom margin is the negative value of the footer's height */
      position: relative;
    }
    #content {
      background-color: pink;
      width: 400px;
      padding: 25px 30px 25px 30px;
      position: absolute;
      bottom: 30px;
      top: 150px;
      margin-left: 100px;
    }
    footer {
      margin: -30px 0 0 0;
      width: 100%;
      height: 30px;
      background-color: green;
    }
    <div id="wrapper">
    
      <header>
        <div id="logo"></div>
    
        <nav>
          <ul>
            <li>About</li>
            <li>Menu</li>
            <li>Specials</li>
          </ul>
        </nav>
      </header>
    
      <div id="content">
        content
        <br>goes
        <br>here
      </div>
    
    </div>
    
    <footer>footer</footer>

    You probably don’t want to be setting the width, padding, margins, ect. of the wrapper. Also, with absolute positioning you can pull the bottom and top of the content to where you want them.

    Here’s what you are after, I think.

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

Sidebar

Related Questions

I wish to have a page that has a fixed height (without scroll bars).
I have a page that has a header, a footer middle section that should
I have a page that has 2 areas: header and content. The header should
I have a page with a variable-height header, content area, and footer. I want
I have a page that has 3 variables. They look like this: String[] Headers
I have a page that has fields dynamically loaded via JQuery. It allows a
i have a page that has sections as divs with inner divs and content.
I have a page that has 2 columns of words, 20 total, that are
I have a page that has a bunch of user controls on it. I
I have a page that has a large image on it with a number

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.