Re: margins on floated elements
David Perrell writes:
> Bert Bos wrote:
> > [two sections of the new CSS1 spec]
> > Does it correspond to what you wanted?
> It sure looks like it!
> The only case I illustrated that isn't addressed is where the floated
> element has negative margins on the content side, and the content is
> allowed to overlap the floated element within the area of the negative
> margins. This should be true of inline elements also. Vertical margins
> of an inline element could then be set negative such that an element
> taller than the line height would not expand the line-box -- the text
> above and below would overlay the element.
That is certainly the intention, both for floating elements and for
We should probably make it explicit which overlaps which. In the
absence of explicit z-ordering, the best strategy is probably that
non-floating things overlap floating things and that things later in
the logical (document) order overlap earlier things.
> This preview piques my curiosity... Will auto width of floated text
> (including any margins, borders and padding) be the lesser of (the
> width of the text) and (the width of the parent element)? Are first
> line indents preserved when text wraps around a floating element, so
> that a negative indent can overlap the floating element with the first
> line? Collapsed vertical margin for nested elements? Hmmm. That seems
> like a good idea!
First line indents (text-indent property) should be implemented as if
the indent is a (very wide, blank) character, just like in the old
days, when the indent *was* a character: the quad. It is not an offset
from the left margin, but a real, non-collapsible space, inserted
before the first letter. It will be there, even if the first line is
shifted to the right by some floating element.
Somebody else already indicated that this wasn't stated explicitly, so
we may need to add a line to this efect.
Like all metaphors, the quad metaphor breaks down as well, since
nowadays text-indent can be negative... A negative text-indent should
indeed work like you described: it causes the first line to overlap
any floating element on its left side.
The effect of setting the width of a floating element (other than an
image) to `auto' is currently not defined.
If we decided to define it, what would be the most useful
interpretation? When I implemented this myself, I arbitrarily used 1/3
of the parent's width. But a more sophisticated sizing algortihm is
possible as well, a la the table sizing. Requiring that would put some
burden on the implementations, but it may be worth it; it may give us
something very close to run-in headings for free...
> (Not sure what the problem with the URL was... works for me)
No luck yesterday, but it's working today.
Bert Bos ( W 3 C ) http://www.w3.org/
firstname.lastname@example.org 2004 Rt des Lucioles / BP 93
+33 93 65 77 71 06902 Sophia Antipolis Cedex, France