Lauri Raittila <lauri@raittila.cjb.net> writes:
[color=blue]
> in comp.infosystems.
www.authoring.stylesheets, Jón Fairbairn wrote:[color=green]
> >
> > I keep reading the definition of CSS2, but am having
> > difficulty acquiring the precise meaning of certain of the
> > concepts.[/color]
>
>
http://www.cl.cam.ac.uk/~jf/StyleTes...dRelative.html
>[color=green]
> > <p> Should this text be within the boundary of the container
> > with the teal background?[/color]
>
> No.[/color]
This is one of the things I find difficult to like.
[color=blue]
> IE has bug, as well as about 7.5x Opera, Opera before that gets it
> correct, Opera after that gets it correct only in standards mode.[/color]
The full doctype on my page is sufficent to cause Opera to go
into standards mode, isn't it?
[color=blue][color=green]
> > <h2>Relative, left: 33%, top: 0</h2>
> > <p> Where (horizontally) should this block appear?</p>[/color]
>
> Same as whitout relative positioning.
>[color=green]
> > <p> Where (vertically) should the text in this block appear?</p>[/color]
>
> 33% of container width from left inner edge of container.[/color]
You seem to have your answers swapped? The left edge should
be 33% of the container width from where it would appear
without positioning, and the top exactly where it would have
appeared.
[color=blue][color=green]
> > Uncomment this division and it is clear that the
> > float should be contained within the bounds of the
> > teal container.[/color]
>
> Correct. There is bug in Gecko. It doesn't like empty elements.[/color]
OK
[color=blue][color=green]
> > Mozilla 1.7.2, firefox 1.0PR and konqueror 3.1.4-7 all
> > display the same way, though not as I would expect.[/color]
>
> I am surpriced of konqueror. Does it make diffrence, if
> you use nonempty div for clearing up stuff?[/color]
I'll have to check this later; the machine I'm using now
doesn't have konqueror. The browser specific aspects of what
follows concern Opera 7.6
[color=blue][color=green]
> > Opera 7.54 Final gives a different opinion about the
> > containment question, and MSIE6 on W98 is in a world of
> > its own, although in one respect does what I expect when
> > none of the others does.[/color]
>
> Opera 7.6 preview 3 gets everything correctly.[/color]
I've just looked at the page with 7.60 p3, and I'm not
convinced. I'm willing to accept that the bottom of an
overlong float should poke out of the container (if I can
find the right piece of verbiage in the docs), but I don't
see how the positioning of the inner block can be right.
If you replace "left: 33%" with "left: 0", the text in
#inner appears below the float. Now, the bits I've read
about relative positioning lead me to understand that the
effect should be to format the block as if it were not
positioned, and then move it by the amount specified. But
Opera changes the shape of the block after it has moved it.
One of the difficulties is that rather than making #inner
flow past the float, it is the content of #inner that does
the flowing.
[color=blue][color=green]
> > For the containment question, I see this (REC-CSS2, 11.1):[/color]
>[color=green]
> > none of these applies. What others are there?[/color]
>
> float is taken out of normal flow. So it is not really
> content of said block.[/color]
I can accept that, as far as containment is concerned.
[color=blue][color=green]
> > relative
> >
> > The box's position is calculated according to the
> > normal flow (this is called the position in normal
> > flow). Then the box is offset relative to its normal
> > position. When a box B is relatively positioned, the
> > position of the following box is calculated as though
> > B were not offset.[/color]
>
> If you both float and relatively position element, it is
> implemented mostly as if relative positioning is done
> after float is taken out of flow, but it seems that it
> should be done first. Irrelevat on your current test
> page..[/color]
Yes. I'm only relatively positioning a normal block.
The problem I'm having is in building up a picture of what
the formatting of the content of a block depends on. It
seems reasonable to expect that it will depend on either the
width, height (, padding &c) specified for the block (which
may themselves be dependent on the container, and where not
specified, the intrinsic dimensions of the content.
It's much less clear that it need be the case (in future
stylesheet languages) that it should also depend on such
things as whether there is anything floating in the
containing block. Certainly the /position/ depends on such
things, but is it really necessary that the flow inside the
block be disrupted that way?
In
<div id="a">
<div id="f" style="float: left;...">
...stuff...
</div>
inline level stuff
<div id="b">...
</div>
</div>
The "inline level stuff" will flow around to the right of
"f". Now, since "b" doesn't have "clear" set, I would expect
that (assuming it's small enough and that "inline level
stuff" doesn't take us past the float) "b" should also
appear /as an entire block/ to the right of "f". (If "b" had
"display: inline" it would be different).
What happens in the present scheme appears to be that "b" is
positioned below "inline level stuff", but instead of being
positioned to the right of "f", it overlays it, and its
padding-left is replaced by max(padding-left(b),width(f)) to
leave room for "f". I would expect this to be the source of
much confusion, as well as requiring too much knowledge
about the environment when coding inner blocks.
--
Jón Fairbairn
Jon.Fairbairn@cl.cam.ac.uk