Re: Being clear about clear

Hello Tom,
Tuesday, November 19, 2002, 4:55:11 PM, you wrote:

>  "This property indicates which sides of an element's box(es) may
>   not be adjacent to an earlier floating box."

> But then goes on to say for the "both" value:

>  "The generated box is moved below all floating boxes of earlier
>   elements in the source document."

> So which should it be? Just adjacent boxes or all previous floating
> boxes? From my tests, both IE6 and Gecko only clear adjacent boxes.
> Opera sometimes does and sometimes doesn't.

I agree the two sentences at first appear to contradict each other.
After reading them both and thinking about them a great deal, I don't
see a contradiction. In CSS 2.1, the definition of 'both' has been
clarified:

 "The top margin of the generated box is increased enough that the top
  border edge is below the bottom outer edge of any right-floating and
  left-floating boxes that resulted from elements earlier in the
  source document."

In short, 'left' moves the generated box below left-floating boxes
(thus the adjacent side is left), 'right' moves the generated box
below right-floating boxes (thus the adjacent side is right), and
'both' moves the generated box below right- and left-floating boxes
(thus the adjacent sides are left and right, which can be described as
"both" or "all").

I think the last bit caused the confusion, because instead of saying
"left- and right-floating boxes," CSS2 says "all floating boxes." In
reality, there are only two types, right-floating and left-floating.

-- 
John

Received on Wednesday, 20 November 2002 00:25:07 UTC