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

>>> 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 UTC