Re: body:first-char and specificity of selectors

Neil St.Laurent wrote:
<<
P:first-letter { font-size: 2cm; }
EM { font-size: larger; }

<P><EM>Hello</EM> out there puts an EXTREME emphasis on the first
letter of Hello, even though the EM would likely be happier with the
2cm on it's first letter:
>>

I imagine an EMphasizer as most happy when allowed to emphasize.

However, I'm wrong about P:first-letter not having a child if I'm correct
about :first-letter properties displaying in EM. The first letter of EM is
child of P:first-letter and the remainder of EM is child of P:

  <P><P:first-letter><EM>H</EM></P:first-letter><EM>ello</EM> ... </P>

So, if not verboten by the CSS2 draft,

   P:first-letter EM { font-size: 2cm }

would give the effect you desire.

David Perrell

Received on Thursday, 18 December 1997 14:50:05 UTC