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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:10:10+00:00 2026-06-07T12:10:10+00:00

I continuously find myself having problems with elements floated right in IE7. I have

  • 0

I continuously find myself having problems with elements floated right in IE7.

I have read many Stack Overflow questions which are similar to this one but there doesn’t seem to be any consistently clean CSS answers.

What I mean by this is is I want to see answers which DO NOT change the HTML. E.g:

  • Put the floated element first
  • Add a ‘clear: both’ div after the floated element.

I understand that sometimes the floated element doesn’t account for its parents height and therefore sometimes fails to contain it properly. Occasionally I find myself ‘adding layout’ to an element with zoom: 1 which sometimes fixes it. Other times I find myself messing about in a conditional IE7 style-sheet which isn’t the best fix in my opinion.

Note: What I mean by ‘having layout’ – http://www.satzansatz.de/cssd/onhavinglayout.html

I have also read other answers to do with using relative and absolute positioning (parent div and child div respectively). This pulls it up but often affects surrounding divs.

I would be happy to add a bounty to this question if someone can give an in depth explain as to the reasons this happens and a detailed discussion of the various fixes, IDEALLY CSS ONLY!

Many thanks!

EDIT

The most common problem I encounter is when I have something like this:

Left Sidebar – Main – Right Sidebar

Right will often drop when floated. Ideally this should be in the format Left – Right – Main, but I continuously find myself styling developers work (Drupal mainly) where this is the case and it is too much hassle to get them to change their work. Make sense? Because I’m styling developers work they never put the clear block in too (which personally I think is horrible and dirty anyways!)

  • 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-06-07T12:10:13+00:00Added an answer on June 7, 2026 at 12:10 pm

    Introduction

    Your title indicates a desire to see a fix for the float: right drop bug, but your text implies some broader scope desire to see solutions to “problems with elements floated right in IE7.” There are many general problems with floated elements (right or left) in that browser. Even though one may question whether support of the IE7 browser is worthy of much attention any more, it undoubtedly will remain so for some people for some time. Therefore, I’m going to take the opportunity here to address numerous issues at once regarding floats in that browser. Note that many experiments and references below come from an excellent resource: http://www.brunildo.org/test/index.html.

    CSS for the Containing Element

    For a containing parent to the floated element the following css should be set:

    .container {
        overflow: auto; /* forces clearing of the child float */
        zoom: 1; /* give it layout (this can be some other css that does likewise) */
    }
    

    Making sure it hasLayout is important to prevent types of margin and padding errors, a type of peek-a-boo bug, and allowing the overflow to clear. For a sequence of floats, some html may need changing if padding on the container is desired to work properly.

    With regards to one “drop” issue with a float: right, you may want to avoid setting an explicit height or max-height on the container. A min-height is okay. Setting a height and then having the float be taller than the container makes IE7 not behave with following elements. There is no pure css solution that I have found noted.

    If the container is itself position: absolute there can be issues with positioning a float that may require that float itself to be set to position: absolute instead of being floated.

    References:

    • For overflow to clear — http://www.quirksmode.org/css/clearing.html
    • Margins — http://www.brunildo.org/test/IEFloatAndMargins.html
    • Peek-a-boo — http://www.brunildo.org/test/iew_boo.html and http://www.brunildo.org/test/iew_boo3.html
    • Float sequence padding — http://www.brunildo.org/test/IEmfloa.html
    • Avoiding height — http://austinmatzko.com/2007/07/25/internet-explorer-7-float-bug/, http://www.brunildo.org/test/fenc7.html (and his similar problem link on that page).
    • Container is absolute — Floating Too Far Right!

    CSS for the Floated Child

    For a the floated child element, the css (besides float: right) to set depends on two things:

    Absolute Container

    Again, as noted above, a containing parent that is absolute may require a change in how the child is handled.

    Float is Also a Clearing Element

    If the float is also going to have a clear set on it, then there are numerous issues that can arise depending totally upon the html and css of the elements around it. There is no single canonical fix, so look at the references below.

    References:

    • Container is absolute — Floating Too Far Right!
    • Also having clear — http://www.brunildo.org/test/IEWfc.html, http://www.brunildo.org/test/IEWfc2.html, http://www.brunildo.org/test/IEWfc3.html

    CSS for Child Elements of Container Before the Float

    If the float: right follows an element in the html structure that should be to its left (and not above it), then that preceding element(s) must be float: left.

    CSS for Child Elements of Container After the Float

    A Clear Element

    For an element after the float that has clear set, then if it has padding and background-color, make sure it also hasLayout to avoid a doubling of the padding; also this prevents extra space above the clear due to container padding, and avoids other margin issues.

    References:

    • For padding — http://www.brunildo.org/test/IEClearPadding.html and http://www.brunildo.org/test/IEFloatClearPadding.html
    • For margins — http://www.brunildo.org/test/Op7_margins_float.html (look down the page for IE7)

    A Paragraph Before a Clear Element

    Having a paragraph with a margin-bottom and shorter in height than the float, located between the floated element and a clearing element, can create an extra gap between the clear and the float equal to that margin. There is no known pure css fix other than giving the paragraph a zero bottom margin (which may not be acceptable if the paragraph may go taller than the float).

    Reference:

    • Paragraph following — http://www.brunildo.org/test/IEFloatClearMargin.html

    Conclusion

    I cannot guarantee I have addressed every issue that may occur with a right floated object, but certainly many major ones are covered. As to “why” these things happen, it is all “bugginess` in IE7.

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

Sidebar

Related Questions

I continuously find myself having to write timed windows services that poll outside queues
i have read many posts but can not find my answer.my question is a
I am having some problems with the find function in MATLAB. I have a
I have an application that is used in image processing, and I find myself
I've read many of the posts regarding this issue and I can't find one
Suppose I have a sequence x1,x2,x3.....xn, and I want to find the longest continuous
I have a C# application..I continuously get a null reference exception..I manage to catch
I have created a desktop application which continuously changes the image on a fixed
I have a windows service which runs continuously and creates some threads to do
I have a process which gives me continuously output in Screen. I want to

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.