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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:11:57+00:00 2026-05-12T15:11:57+00:00

I have following CSS code and my floats are dropping out of their containers.

  • 0

I have following CSS code and my floats are dropping out of their containers. Firefox doesn’t have this problem. What could be reason for this behaviour?

<div class="container">
    <div class="leftmenu">
        ... some stuff here ...
    </div>
    <div class="rightmenu">
        <div style="float: right; text-align: right;">
            <button class="ui-state-disabled ui-state-default ui-corner-all"> Button 1 </button>
            <button class="ui-state-disabled ui-state-default ui-corner-all"> Button 2 </button>
            <button class="ui-state-disabled ui-state-default ui-corner-all"> Button 3 </button>
            <button class="ui-state-disabled ui-state-default ui-corner-all"> Button 4 </button>
        </div>
    </div>
</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-12T15:11:58+00:00Added an answer on May 12, 2026 at 3:11 pm

    The container, in your case “div.container”, will not be able to calculate the correct height of itself once its children are floated. If there are any child blocks that are not floated, the container will use the height of the tallest one among them.

    A container with both of its child blocks floated is common anyway. There are certain ways to fix this. Consider the approaches summarized by QuirksMode the best. http://www.quirksmode.org/css/clearing.html

    So, to solve your problem, just add this in your CSS file.

    div.container { overflow: auto; width: 100%; } 
    

    NOTICE: The width value could be any value you want. but it is obligated to trigger the HasLayout behavior in IE[67]

    Another work around. You may use an extra div:

    <div style="clear: both;"></div>
    

    Add this after div.right in div.container.

    However, there is better way to do this. Add an .clearfix utility class in your CSS:

    .clearfix {
      *zoom: 1;
    }
    
    .clearfix::before,
    .clearfix::after {
      display: table;
      content: "";
    }
    
    .clearfix::after {
      clear: both;
    }
    

    Add clearfix to the class attribute of div.container.

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

Sidebar

Related Questions

I have the following CSS code, works fine with Firefox, Chrome but breaks like
I have the following CSS code, and my problem is that my nav bar
I have the following code: <a accesskey=b class=icon icon-foo href=/aa>this is a test</a> CSS
I have the following css code h1, h2, h3, h4 { color: #333; font-size:
I have the following CSS code being used for centering an <img> tag .img
I have the following css code. button.png is image where 3 button states are
I have the following CSS code .editable:before { content: url(../images/icons/icon1.png); padding-right:5px; } this is
I have the following html/css code . When I have the screen resolution to
I have the following code CSS select.select { color:#FFFFFF; height: 15px; width: 105px; background:#996633
I have the following html and css code: <!DOCTYPE HTML> <html> <head> </head> <body>

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.