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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:51:36+00:00 2026-05-24T17:51:36+00:00

I have some troubble with a web page I’m making… I have a div

  • 0

I have some troubble with a web page I’m making…

I have a div that contains all elements on the page (or rather all elements between the header and the footer of the page, but that’s irrelevant). The height of the body div changes due to the content it’s holding.
The wrapper holds one div with id=”content” that is supposed to hold whatever content I want displayed on the page, one div I use as a button (id=”collapse”) and one div (id=”calendar”) that creates a field that will hold a list of events comming up.

CSS:

#body {
    height:500px;
    min-height:250px;
    width:100%;
    background:#fc0;
    padding-bottom:100%;
    margin-bottom:-100%;
}
#calendar {
    float:right;
    height:100%;
    width:20%;
    border-left:10px solid #678DC0;
    background:#b0c4de;
    padding-bottom:100%;
    margin-bottom:-100%;
}
#collapse {
    float:right;
    margin-top:10px;
    text-align:left;
    padding-left:10px;
    padding-top:20px;
    padding-bottom:20px;
    background:#678DC0;
    border-top-left-radius:25px;
    -moz-border-top-left-radius:25px; /* Firefox 3.6 and earlier */
    border-bottom-left-radius:25px;
    -moz-border-bottom-left-radius:25px;
}
#content {
    height:auto;
    width:100%;
    background:#b0c4de;
    text-align:center;
    padding:50px;
}

HTML:

<div id="body">
<div id="calendar"></div>
<div id="collapse">>></div>
<div id="content"></div>
</div>

Now this is my problem: If I set #body height:auto; the float of the #collapse div and the width of the #content div acts wierd. #collapse div floats all the way to the edge of the #body div instead of stopping when it floats into the #calendar div. Same thing with the #content div. It stretches till the #body edge, not till the #calendar.

Hope I’ve given you a proper formulation. Any questions of what I’m asking for?

Any ideas?

  • 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-24T17:51:36+00:00Added an answer on May 24, 2026 at 5:51 pm

    As Ryan commented you can use the clear style to properly position your floated elements. I set up a test page here: http://jsbin.com/apinuj/2/edit#html,live, demonstrating how to use the clear fix on your html so that the body div is properly aligned when set to height: auto.

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

Sidebar

Related Questions

I have this web page I'm developing that displays multiple images of one product
I have a button on a web page that when clicked connects to my
I have a web app, that consumes a web service. The main page runs
I'm have some trouble with the fulltext CONTAINS operator. Here's a quick script to
I know that similar questions have been asked all over the place, but I'm
Im new to web development and Im having some trouble getting my elements to
In my default.aspx page, I have some ESRI tools (and some commands) in a
Does anyone have any good starting points for me when looking at making web
I have a single page that has a number of controls configured a certain
I'm having some trouble with my web page. A picture probably descibes it best

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.