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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:37:56+00:00 2026-05-27T12:37:56+00:00

So I have three div’s One parent and two child. The parent is as

  • 0

So I have three div’s

One parent and two child.

The parent is as follows:

#parent {
  overflow:auto;
  margin: 0 auto;
  margin-top:37px;
  min-height: 100%;
  width:875px;
}

the two child divs are as follows

#child1 {
  overflow:auto;
  min-height:150px;
  border-bottom:1px solid #bbb;
  background-color:#eee;
  opacity:0.4;
}

#child2 {
  height:100%;
  background-color:white;
}

The parent div extends 100% as I can see the borders of it till the end of the page but the child2 is not extending down to the end of the page like the parent div.

  • 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-27T12:37:57+00:00Added an answer on May 27, 2026 at 12:37 pm

    height doesn’t behave the way you seem to be anticipating. When you specify height: 100% that percentage is calculated by looking up the DOM for the first parent of said element with a height specified that has absolute or relative positioning.

    You can cheat when it comes to the body tag, so if you had something like this:

    <body>
      <div style="height: 100%">
      </div>
    </body>
    

    Some browsers/versions will behave the way you expect by taking up the total height of the page. But it won’t work when you go any deeper than that.

    Here is the approach I use to strech a div to the bottom of the page, it involves absolute positioning (nice thing about this one is that it is pretty cross-browser compliant and doesn’t require javascript to pull it off):

    <div id="parent">
       <div id="childNorm"></div>
       <div id="childStrech"></div>
    </div>
    
    
    
    #parent
      {
          position: absolute;
          width: 1000px;
          bottom: 0;
          top: 0;
          margin: auto;
          background-color: black;
      }
    
      #childNorm
      {
         position: absolute;
         width: 1000px;
         top: 0;
         height: 50px;
         background-color: blue;
         color: white;
      }
    
      #childStrech
      {
         position: absolute;
         width: 1000px;
         top: 50px;
         bottom: 0;
         background-color: red;
         color: white;
      }
    

    Here is a Jsfiddle for demo: http://jsfiddle.net/t7ZpX/

    The trick:

    When you specify absolute positioning and then put in bottom: 0; that causes the element to stretch to the bottom of the page; You just have to worry about positioning the elements as a trade off.

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

Sidebar

Related Questions

Say that I have three button elements in one parent div. Assuming that these
If I have three tabs: <div id=tabs> <ul> <li><a href=#sample-tab-1><span>One</span></a></li> <li><a href=#sample-tab-2><span>Two</span></a></li> <li><a href=#sample-tab-3><span>Three</span></a></li>
i have one div that contain three div for a part in my website
I have three span tags: One is floated left (A) and the other two
I have a parent div, that holds three div's. They are basically columns. I
I have three div's next to eachother, but when the content of one or
I have three div's on my page. I want to show the div's one
I have three columns which are div s acting like table cells, one in
I have three div tags, a wrapper and two side by side within the
I have three divs : <div id=login /> <div id=content /> <div id=menu />

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.