Firefox Float problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Brown
    New Member
    • Sep 2007
    • 2

    Firefox Float problem

    I can't seem to get float to work at all in Firefox, but it works just fine in IE7. I'm using FireFox 2.0.0.6. This seems so basic I can't believe it is a bug, but I just can't understand why it doesn't work for me.

    you can check it out here:




    Thanks
  • Tom Brown
    New Member
    • Sep 2007
    • 2

    #2
    I seem to have discovered the issue:

    This worked fine:
    <div id="one">text</div>
    <div id="two">text</div>
    #one
    {
    float: left;
    }


    #two
    {
    clear: left;
    }

    but I needed this:

    #one
    {
    float: left;
    }


    #two
    {
    float: left;
    }


    which wasn't working
    until I added this:


    #one
    {
    float: left;
    width: 30px;
    }


    #two
    {
    float: left;
    width: 30px;
    }

    Seems it Firefox needs widths and IE 7 doesn't. Mystery solved!

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      It's no mystery, the bug, as usual, is with IE. If there is no width, the div should collapse to nothing. IE doesn't follow the rules. After all, IE7 is nine years behind web standards.

      Never, ever use IE as a reference for how things should work. Always, always use a modern browser, such as Firefox, Opera or Safari.

      Comment

      Working...