[Note: Follow up set to n.p.m.layout, but change it if more appropriate.]
Reading through <http://www.w3.org/TR/CSS21/visuren.html#floats> and <http://www.w3.org/TR/CSS21/visuren.html#float-rules> I still can't explain why Mozilla (NS4 and IE, too) renders the following simple example like this:
[snip]
So in the first paragraph: Why the "right" element is shifted down? Why the "left" element is shifted down in the second paragraph?
I have no idea if this behaviour is officially broken, although it may be less than ideal. Before I explain what is happening, here is a good example of the problems of floats:
Start with a long line of text, that only just fits in the with browser window, but what happens if you put a floating item right after the text in the source? (assuming the float it wider than the space left)
If you go with the strict CSS 2.1 way, you place the float top level with the top of the text - but the last word wraps now! Thus, buy rule 6 of CSS 2.1, the float must be moved down so it's top matches the top of the new 2nd line of text. But now the last word can fit on the fits line again. Welcome to the wonderful world of recursion. ;)
Firstly, the only solution to this is to wrap even though the word does actually fit on the line.
Secondly, the 'simple' solution is to make floats appear just *below* their containing line-box, as can be seen in your example twice.
Yes this is a cop-out in many ways. Clearly the Opera people have managed to get this working 'properly', but not all of us are paid to do this. :)
Probably all you want is how to make this work - well that's easy enough, just make sure you put all the floating items before the normal text.
I hope that helps, even if it was a bit long-winded.
-- James Ross <[EMAIL PROTECTED]>
You fight with demons! You're supposed to be *brave*!
-- Sota
(Inu-Yasha, by Rumiko Takahashi)_______________________________________________ Mozilla-layout mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-layout
