Previous Message
Next Message

3 'left' floats followed by 3 'right' floats

Sent by Bruno Fassino on 28 August 2004 22:10


Bill Merikallio wrote:

> I have a 'float' theory question.
[...]
> I wanted to put the main content divs in the markup first
> followed by the sidebar content, but I couldn't get it to
> work without wrapping the first three divs in a container
> (or alternating left and right floats).
>
> I've posted a simplified example at
> http://www.hotdesign.com/css-d/float-question.html
>
> What am I missing here? Why don't the divs that are floated
> right go up to the top?

IMO the behaviour that you see (except in Opera 7) is correct, according to
the spec [1].
The relevant rule is the fifth:

"The outer top of a floating box may not be higher than the outer top of any
block or _floated_ box generated by an element earlier in the source
document."

So your first right float cannot go higher that the preceding left float.
As you have seen, wrapping the 3 left divs in a single float allows the
right ones to go up, without breaking the rules because of this:

"References to other elements in these rules refer only to other elements in
the same block formatting context as the float."

BTW, I've seen this Opera wrong behaviour in other similar cases. It seems
to be new in Op7, Opera 6 is correct.


HTH,
Bruno


[1] <http://www.w3.org/TR/CSS21/visuren.html#float-position>

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: