Annoying Float Bug in Firefox
So I just ran into a really annoying float bug in Firefox (ironically discovered when trying to fix the header navigation of the Drupal SpreadFirefox theme). When you do a double-float right, or a float right inside an absolutely positioned div, the top-most container becomes a screen-filling monstrosity.
See the following:
<style type="text/css">
#floated {position:relative;float:right;
color:black;background:#999;border:1px solid black;opacity:0.5}
#floated div {position:relative;float:right;
border:1px solid black;padding:2px;margin:.5em;}
</style>
<div id="floated">
<div>test 1</div>
<div>test 2</div>
</div>
In Safari, test 1 and test 2 float right, with the containing div surrounding them in a nice discrete little box. In Firefox, the containing div fills the whole width of the page.
Note that when test 1 and test 2 float left, it works as expected in Firefox - regardless of the containing div's float or absolute positioning:
But unfortunately this would reverse the tabs in Drupal SpreadFirefox without other code-level alterations.


Leave a comment