W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: CSS: %% / 'calc' length unit

From: Anne van Kesteren (fora) <fora@annevankesteren.nl>
Date: Fri, 07 May 2004 17:09:56 +0200
Message-ID: <409BA6C4.6090408@annevankesteren.nl>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: www-style@w3.org

>>> foo, bar { display: block; }
>>> foo { width: calc(50% - 100px;) }
>>> bar { width: inherit; }
>>>
>>> <foo>
>>>   <bar />
>>> </foo>
>>>
>>> What does bar inherit?
>>
>> The computed value from FOO? (If I understand the parts about CSS 2.1 
>> "computed values" and "inheritance" correctly.)
> 
> And that is?  I'm looking for specifics, not generalities. What can I 
> replace the "bar { width: inherit; }" rule with that will give the same 
> layout in this case without using "inherit"?  That is, what is the 
> computed value?

Depends. If FOO is the root element and the viewport is 400px width, 50% 
will become 200px, and the width wel be 200px - 100px = 100px. BAR will 
inherit that.

If the viewport is only 150px width, the 'width' of FOO will become '0' 
as you told me and BAR will inherit that.

(If this is not what you meant, could you say it more explecit and 
perhaps give a more clearer example?)


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>
Received on Friday, 7 May 2004 11:23:18 GMT

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