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

Anne van Kesteren (fora) wrote:
>> 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?

>> Yes, but _when_ the calculation happens is key.  Also, conversion to 
>> px is lossy in many cases, leading to rounding issues.
> 
> Rounding should obviously be done at the latest moment possible, not?

Yes, but considering that px in CSS can be fairly arbitrarily sized, you could 
get rounding issues immediately at conversion time...

-Boris

Received on Friday, 7 May 2004 11:04:50 UTC