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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:23:24+00:00 2026-05-11T10:23:24+00:00

I have a few nested divs: <div id=wrapper> <div id=header> <!– a bunch of

  • 0

I have a few nested divs:

<div id='wrapper'>   <div id='header'>     <!-- a bunch of float divs here -->   </div>    <div id='body'>     <div id='content'>       <!-- a bunch of html controls here -->     </div>   </div> </div> 
  • wrapper style: width: 780px; margin: 20px auto; border: solid black 5px;
  • header style: position: relative; min-height: 125px;
  • body style: position: relative;
  • content style: position: absolute; left: 50px; top: 0px;

I have a bunch of html elements in the content div and for some reason the body div and the wrapper div are collapsing around the header and the content div hangs out on its own if I don’t set a fixed height for the body div. The only float elements I have are in the header.

EDIT:

If I remove the content div (and drop the html elements directly in body) the body div stops collapsing! Trying to understand why – guess it’s due to the position: absolute of the content div.

Any clue why this is happening and how to solve?

I had a look at this question but It doesn’t seem to work for me (or maybe I am clearing inthe wrong place…).

  • 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. 2026-05-11T10:23:25+00:00Added an answer on May 11, 2026 at 10:23 am

    You don’t really need to use absolute or relative positioning in this case.

    The following achieves what you need with a minimal amount of css wrangling.
    Colours becuase I like colour, and so should you!

    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'     'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html>     <head>         <meta http-equiv='Content-type' content='text/html; charset=utf-8' />         <title>Page Title</title>         <style type='text/css' media='screen'>     #wrapper {          width: 780px;          margin: 20px auto;          border: solid black 5px;      }     #header {          min-height: 125px;          overflow:hidden;      }     #body {          background-color:red;       }     #content {          margin-left: 50px;         margin-top: 0px;         background-color:pink;        } .floatie { float:left; width:40px; height :40px;      margin:5px; background-color:#fe0;}          </style>       </head>     <body>            <div id='wrapper'>           <div id='header'>                 <div class='floatie'></div>                 <div class='floatie'></div>                 <div class='floatie'></div>                 <div class='floatie'></div>                 <div class='floatie'></div>                 <div class='floatie'></div>                 <div class='floatie'></div>           </div>            <div id='body'>             <div id='content'>                  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,                      sed do eiusmod tempor incididunt ut labore et dolore                      magna aliqua. Ut enim ad minim veniam, quis nostrud                      exercitation ullamco laboris nisi ut aliquip ex ea                      commodo consequat. Duis aute irure dolor in                      reprehenderit in voluptate velit esse cillum dolore eu                      fugiat nulla pariatur. Excepteur sint occaecat                      cupidatat non proident, sunt in culpa qui officia                      deserunt mollit anim id est laborum.</p>             </div>           </div>         </div>      </body> </html> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 271k
  • Answers 271k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer After trying some more on the VB6 activeX control, I… May 13, 2026 at 1:43 pm
  • Editorial Team
    Editorial Team added an answer SELF-ANSWER: So based on Philippe's answer to my original question… May 13, 2026 at 1:43 pm
  • Editorial Team
    Editorial Team added an answer It's probably not a good idea but it can be… May 13, 2026 at 1:43 pm

Related Questions

I have a few nested divs: <div id=wrapper> <div id=header> <!-- a bunch of
I have an ASP.Net web page, which uses a Master Page template. The page
It seems to be the general opinion that tables should not be used for
I have this big data-entry sort of page, a table kind of layout using
I have been using Selenium a lot lately (testing an ExtJs app) and while

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.