W3C home > Mailing lists > Public > www-style@w3.org > December 1997

body:first-char and specificity of selectors

From: Neil St.Laurent <neil@bigpic.com>
Date: Wed, 17 Dec 1997 11:28:15 -0600
Message-Id: <199712171818.LAA01821@underworld.bigpic.com>
To: www-style@w3.org
Implementing a style tree somethint quickly came to mind about 
pseudo-classes / pseudo-elements.  If the current pseudo-element is 
:first-line does the inhertied value come from the parent's style, or 
the parent's style if it were a first-line?


BODY { color: red }
BODY:first-line { color: blue }
EM:first-char { font-size: bigger }

<P>Hello this is some text.  Is the first-line of this text red or 
blue?  And also, does <EM>First-char</EM> work anywhere, or does it 
only apply to the first character of each new block level element?

I'm thinking that BODY:first-line is a pointless pseudo-element and 
nothing will ever consider its properties?

Which is of a higher specificity:

P:first-char EM
P EM:first-char

That is, which would be applied to

Or what if I add to the styles:
BODY P  :first-char
P ~ EM
EM EM:first-char

I'm trying to find a definitive way to find specificity of the 
selectors, but it appears not to be trivial as I hoped...

| Mortar: Advanced Web Development <http://mortar.bigpic.com/>
| Neil St.Laurent                  <mailto:stlaurent@bigpic.com>
| Big Picture Multimedia
Received on Wednesday, 17 December 1997 13:22:08 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:46 UTC