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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:31:04+00:00 2026-06-17T09:31:04+00:00

I am having a strange problem with CSS 100% height. The site of my

  • 0

I am having a strange problem with CSS 100% height. The site of my site is as follows:

<html>
  <body>
    <div id="container">
      <div id="header"></div>
      <div id="content"></div>
    </div>
  </body>
</html>

I am trying to get container to have a minimum height of 100% so my CSS is as follows:

html { min-height: 100%; }
body { height: 100%; }
#container { height: 100%; }

The problem is, #container does not fill 100% of the height and only expands according to how much content is in #header and #content, and if #header and #content are empty or removed, #container does not expand at all.

I feel like I have to be overlooking something very simple, but have been looking at this forever and am at a dead end! Can someone point out the problem?

  • 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-17T09:31:05+00:00Added an answer on June 17, 2026 at 9:31 am

    Percentage Heights:
    To set a percentage height to #container, its parent elements must have a specific height. In this case, the specific effect you want can be accomplished using either height:100% or min-height:100%. To achieve either of these, every ancestor of #container must have a height or min-height of 100%.

    html, body, #container {
        height: 100%;
    }
    

    OR

    html, body, #container {
        min-height: 100%;
    }
    

    JS Fiddle Example


    Using min-height vs. height: Within the narrow scope of your question, they will have the same effect. But on a page that has both a height and min-height:

    • If min-height is greater than height (whether specified or unspecified), the min-height will be used.
    • If height is greater than min-height (whether specified or unspecified), the height will be used.

    If there is a max-height specified (e.g. #container { max-height: 50px }) this would overrule height. However, max-height cannot overrule min-height. Read more at this link.

    NOTE: min-height is not supported by some versions of Internet Explorer.

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

Sidebar

Related Questions

I'm having a strange problem. I have a HTML page with PHP code which
I am having strange problem, whenever my site is loaded for the first time
I am having a strange problem, maybe you can help: I'm trying to convert
Having a strange problem with a page set to 100% fluid width which has
I'm having a strange problem positioning a set of divs inside another div. I
I am having strange problem after installing multi-site drupal environment on shared host. When
I'm having a very strange problem with css3 border radius property. My following CSS
I'm having a strange problem where my DIV background is not displayed in Firefox
I am facing the very strange problem in HTML/CSS.I am using chrome 12.0.742.122. Now
So I'm having a strange problem with the Db4o API. I'm trying to retrieve

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.