Re: computed values, inheritance, and short hand

Tantek Çelik wrote:
>
> Splitting up the shorthand in Ian's example derives to:
> 
>   div { border: none 2em red; }
>   span { border-style:inherit; border-color:inherit; border-width:inherit;
> border-style: solid; }
> 
> which simplifies to (since the latter declaration wins in a rule):
> 
>   div { border: none 2em red; }
>   span { border-color:inherit; border-width:inherit; border-style: solid; }
> 
> Now, does the span have a border or not?
> 
> Specifically, does border-width:inherit inherit a zero width computed border
> from the div, due to the div's computed border-style of none?

Per spec, yes.

Imho, though, that's counterintuitive. Perhaps the spec could write that
the *used* value (as opposed to the computed value) of a 'none' or
'hidden' border is zero.

So, the description for 'none' would be (see issue 196)
   >  No border; the used value of the border width is zero.

and the "'0' if the border style is 'none' or 'hidden'" part of the
border-width property definition table would be removed.

   http://www.w3.org/TR/CSS21/box.html#propdef-border-width

~fantasai

Received on Friday, 13 February 2004 14:53:53 UTC