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
> 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 .
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
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.
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/