Re: Actual size of an em-sized shadow

2011/5/3 Kornel Lesiński <kornel@geekhood.net>:
> This case is not interoperable in current browsers:
>
> <div style="font-size: 1px; text-shadow: 0 1em 0 red;">
>    <span style="font-size:10px">How</span>
>    <span style="font-size:20px">much</span>
>    <span style="font-size:30px">is</span>
>    <span style="font-size:40px">one</span>
>    <span style="font-size:50px">em?</span>
> </div>
>
> and appears to be unspecified in current CSS Text WD: "same as defined for
> the ‘box-shadow’", but I did not find anything in description of box-shadow
> that would explain how to compute lengths in elements that inherit a shadow.
>
>
> Firefox, Safari and Chrome pick one length for all of text, but they seem to
> compute it differently.
>
> Opera, although in minority, seems to have most sensible interpretation: em
> in shadow is computed relative to font size in each element.

Unless otherwise specified, you inherit the computed value of your
parent <http://www.w3.org/TR/CSS21/cascade.html#inheritance>.  Ems are
resolved into pixels for computed values, so all of the children
should inherit the same value - "0 1px 0 red".

~TJ

Received on Tuesday, 3 May 2011 21:53:24 UTC