W3C home > Mailing lists > Public > www-style@w3.org > October 1999

Re: Unlogical width with percentages

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Mon, 11 Oct 1999 00:20:04 +0100 (BST)
To: Sjoerd Visscher <sjoerd@heeten.nl>
cc: www-style <www-style@w3.org>
Message-ID: <Pine.GSO.4.04.9910110004220.19089-100000@ss1.bath.ac.uk>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:00 GMT