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

>> The same as will happen with 'width:-100px', obviously. I believe that 
>> becomes 'width:auto', not entirely sure though.
> 
> It becomes 0.  More interestingly:
> 
> 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.)

>> Why is the complex? A browser already have to calculate every unit 
>> into 'px', since that is the where screens are based upon.
> 
> 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?


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Friday, 7 May 2004 10:55:36 UTC