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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:23:27+00:00 2026-05-29T11:23:27+00:00

I have this simple html structure: <div id=mainbody> <div id=main> … </div> <div id=left>

  • 0

I have this simple html structure:

<div id="mainbody">
  <div id="main">
  ...
  </div>
  <div id="left">
  ...
  </div>
</div>
<div id="footer">
...
</div>

The div “mainbody” has position:relative.
The div “left” has absolute position at the left side of the page and dynamic height.
The div “main” floats left at the right of div “left”.

CSS:

#mainbody {
    position:relative;
}
#left {
    position:absolute;
    width:250px;
}
#main {
    float: left;
    margin-left: 260px;
    width:80%;
}

PROBLEM: The height of div “left” is ignored and the div “footer” starts where the div “main” ends even though the div “left” has bigger height than div “main”.

  • 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-29T11:23:28+00:00Added an answer on May 29, 2026 at 11:23 am

    What you are looking for is a clearfix so that your elements will load properly. See the linked SO question “Which method of ‘clearfix’ is best?” for numerous possible clearfixes.

    The reason why the footer element places itself next to the main element is because absolutely-positioned elements are removed from the page flow. As a result, later elements treat the absolutely-positioned element as if it was not there in the first place. With a clearfix, this issue is resolved.

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

Sidebar

Related Questions

I have a simple HTML structure ( jsfiddle ): <li> <div class=buttons> <a href=done><img
I have this simple HTML structure: <ul> <li> One <p> Foo is a fool.
I have this html page which is very simple, it contains a text box
I have a simple html multiline tooltip implementation: this.tooltip = function(tag) { xOffset =
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html
I have a simple app with a full screen UIWebView. This contains HTML generated
This is probably a basic html/css question... I have a simple one-button form that
Hi i have a simple accordion set up with jQuery with the HTML structure
I have a simple div on html, something like: <div class=warning> <h3>Please make sure:</h3>
I have $('#structure').html(html); This works fine in FireFox. IE 8 doesn't display the html.

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.