This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.
Main navigation:
Search reports by browser:
While comparing IE and Firefox 1.5 I found a different behaviour of FF 1.5 to FF 1.0.7.
Using Floats and an end div with clear both with a margin will show different behavior on different browsers. Especially using clear and minus margin in Firefox will not work, FF ignores minus margin in combination with clears.
Test page Workaround is included
Reported by: Thomas Vavra.
Mozilla, Safari | Reported on 3 January 2006.
Posted by Milo van der Leij on 3 January 2006
2From the CSS 2.1 spec:
"Clearance is introduced as spacing above the margin-top of an element. It is used to push the element vertically (typically downward), past the float."
A negative margin-top would stretch into the "Clearing", thus negating the 'clear' effect. However, I don't see why a positive margin-top shouldn't work.
Posted by Anonymous on 7 January 2006
3I don't see why negative top margin cannot be applied to make the cleared element overlap with the float, just like any other two blocks with negative margin inbetween. The float should not displace the inline content of the cleared box, they should simply overlap.
It's pretty much the same as applying a top negative margin to an absolute-positioned element. If it didn't move up I would consider it a bug.
Posted by Tom on 11 January 2006
4So, which browser is behaving correctly? Firefox/Safari/Opera or IE?
Posted by Claire on 8 February 2006
5>>who is correct
as Phillipe says ~ it's not IE. It should ignore the presence of the floats (the top margin should actually be underneath them) and clearance should just extend the top margin by enough to clear the last float.
In the same way a negative margin should not move the the clearing div up under the float (ala Absolute positioning) the clearance rule still says to extend enough to clear floats which is FF1.0.7's small error.
Commenting guidelines:
Posted by Philippe on 3 January 2006
1If anything the bug is in IE Windows and not in Firefox. IE win is plain wrong in its handling of margins on a clearing element. Clear works by extending the margin-box enough to put the element past the float (The way, Opera, Firefox, Safari handle this). Firefox 1.07 is slightly wrong in it's handling of the negative margin test-case linked from this report.