Re: Unlogical width with percentages

On Sun, 10 Oct 1999, Sjoerd Visscher wrote:

>>    <div style="float: right; width: 50%">
>>       <div style="margin: 2em; border: solid 2em; padding: 2em;">
>>       </div>
>>    </div>
>>
>> ...has the same effect as:
>>
>>    <div style="width: 50%; float: right; box-sizing: margin-box;
>>                margin: 2em; border: solid 2em; padding: 2em;">
>>    </div>
>>
>> ...so limiting 'box-sizing' is not really a blocker.
> No, on the contrairy, the first example is clear, while you need to
> think twice for the second one.

Yes, but the first is only half the picture as it does not include the
extra transformation step.

The rules for the first would effectively be:

   div { modifiy-context: div.floatContainer > :selected() } /* STTS */
   div.floatContainer { float: right; width: 50%; } /* CSS */
   div.floatContainer > div { margin: 2em; border: solid 2em; padding: 2em; }

The rules for the second:

   div { margin: 2em; border: solid 2em; padding: 2em; width: 50%;
         float: right; box-sizing: margin-box; }

Now tell me which is clearest...


(Notes: That is the first time I've written some STTS, so don't blame
me if it is wrong Daniel! Also note that it is one line of STTS. I'd
hate to know how long the relevant XSL document would be...)

-- 
Ian Hickson
"I take a Professor Bullett approach to my answers. There's a high
probability that they may be right."
  -- Dr Snow; Mechanics Lecturer at Bath University; 1999-03-04

Received on Sunday, 10 October 1999 19:20:09 UTC