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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:59:07+00:00 2026-06-04T23:59:07+00:00

I am trying to get 2 nested page container div ‘s to have a

  • 0

I am trying to get 2 nested page container div‘s to have a minimum height of the page. I was able to find this code with a single page container, but if I add another outer container, the logic falls apart.

Here is the html and css. (I want the blue and the red div‘s to be the same height. If the <div id='outer'> is removed, the red is what I want.)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>CSS Layout - 100% height</title>
    <style>

 *
 {
    margin:0;
    padding:0;
    border:0;
 }

html,body
{
    height:100%;
    background:gray;
}

div#container
{
    position:relative;
    margin:0 auto;
    width:750px;
    background:red;

    height:auto !important; 
    height:100%; 
    min-height:100%; 
}

div#outer
{
    position:relative;
    margin:0 auto;
    width:800px;
    background:blue;

    height:auto !important; 
    height:100%; 
    min-height:100%; 
}

div#header
{
    background:#ddd
}

div#footer
{
    position:absolute;
    width:100%;
    bottom:0;
    background:#ddd;
}

    </style>
</head>
<body>
    <div id="outer">
        <div id="container">
            <div id="header">
                <p>Sometimes things that used to be really simple with tables can still appear pretty hard with CSS. This layout for instance would consist of 3 cells; two with a fixed height, and a third one in the center filling up the remaining space. Using CSS, however, you have to take a different approach.</p>
            </div>

            <div id="content">
                <p>
                    Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. Testing text goes here. 
                </p>

            </div>

            <div id="footer">
                <p>
                    This footer is absolutely positioned to bottom:0; of  #container. The padding-bottom of #content keeps me from overlapping it when the page is longer than the viewport.
                </p>
            </div>
        </div>
    </div>



</body>

In searching for a result, it appears that this may not be possible because height:100% and min-height:100% only work on the first element after the body. Any suggestions on how to do this? Floating div‘s?

  • 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-04T23:59:11+00:00Added an answer on June 4, 2026 at 11:59 pm

    min-height does not work on nested divs.

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

Sidebar

Related Questions

I am trying to do is to loop this HTML and get a nested
Trying to get comfortable with jQuery and I have encountered some sample code that
I'm trying to get a nested form view to update properly. This is however
Okay. I'm trying to get a page to display 100% of the height of
I'm trying to get regexp to match some nested tags. (Yes I know I
I'm trying to get SQL Server to order by a column from a nested
I am trying to created nested dictionary variable like the below, But I get
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
I'm trying to pass a value to Page.Title in a nested WebForms Master Page,
I'm trying to set some conditional statements for nested embedRelation() instances, and can't find

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.