W3C home > Mailing lists > Public > www-style@w3.org > July 2005

Re: Backwards and Forwards Compatability

From: Orion Adrian <orion.adrian@gmail.com>
Date: Wed, 13 Jul 2005 10:48:00 -0400
Message-ID: <abd6c801050713074869fe22d9@mail.gmail.com>
To: www-style@w3.org

On 7/13/05, Laurens Holst <lholst@students.cs.uu.nl> wrote:
> Orion Adrian wrote:
> >>That is already the case, at least in the example you provide. The top:,
> >>left:, bottom: and right: properties are meant to be used in conjunction
> >>with absolute positioning. That is precisely why I asked why Kris did
> >>use margin instead. He was unnecessarily mixing two posioning methods.
> >>Of course, when margin is used to create spacing *within* absolutely
> >>positioned areas, as I believe Kris did in a later example, it is
> >>relatively safe and correct.
> >>
> >>
> >Currently, it is not possible to use simply use left to get the
> >correct position without margin-left to get it done correctly as well.
> >Left can either serve as a constant portion or a percentage portion of
> >a layout, but in layouts where both are required left is no
> >sufficient, so margin must be used. This breaks guideline 1. To get
> >both you would indeed need calc for it.
> >
> Yes, this is merely a workaround, caused by calc() missing. It does not
> only apply to combinations of absolute units with percentages, but
> applies to any combination of different units, e.g. you have the same
> problem with three boxes of 5em, 500px and a stretching third one. When
> adding more columns with different units, you will need to resort to
> border and padding next, and after that you can go no further.
> But, it is not breaking guideline 1. Absolute positioning does NOT
> require such use of margin to work. Hence your claim that the design of
> absolute positioning is flawd and not designed to degrade properly is
> incorrect.
To sum up: CSS can do advanced layouts using both contstant and
percentage based values, but you shouldn't because it's short-sighted.

> > Instead, he uses one to handle
> >the percentage part (left) and one to handle the constant part
> >(margin). As for the safety of his example, it wasn't very safe. If
> >position: absolute hadn't worked, he would have had quite a mess with
> >different regions being statically placed, but with left and right
> >margins of different sizes. Something like this:
> >
> Correct. But now you are argueing about the example Kris gave, not the
> design of CSS.

I'm saying that there was this big argument that CSS could do certain
layouts and didn't need changing. Well it can, but you shouldn't.

I'm saying that CSS is in a state that it must be abused to get the
desired output.

Secondly because the mechanisms (i.e. left, right, top, bottom) aren't
tied together it's possible to have only two work and end up with
something totally non-sensicle.

An approach that wouldn't have this problem is the creation of
functions that combined the attributes into a single command.
position: region(left, top, right, bottom);
position: point(left, top);
position: rect(left, top, width, height);

Mechanims like these would have prevented the usage of left and top
from messing up layouts that didn't support right and bottom. It
creates more of an all or nothing situation and while it's possible to
do that now using some interlinking property, it's more likely that a
system will process in a manner more to our liking if it's all or
nothing and not piecemeal since the system is probably inaccurate at
what it supports.


Orion Adrian
Received on Wednesday, 13 July 2005 14:48:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:19 UTC