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

Re: body:first-char and specificity of selectors

From: David Perrell <davidp@earthlink.net>
Date: Wed, 17 Dec 1997 16:29:13 -0800
To: <www-style@w3.org>
Message-ID: <01bd0b4b$f73d89e0$421cd9cf@davidp>
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?

Doesn't a block-level element begin a new line? If so, BODY has no
:first-line pseudo-element and the first line of P is red.

":first-char" or ":first-letter"? The CSS2 draft states that ":first-line"
and ":first-letter" can only be attached to block elements. (Why the
restriction, I wonder?)

Which is of a higher specificity:

P:first-char EM
P EM:first-char
That is, which would be applied to

According to the CSS2 draft, both declarations are no-nos, even if you mean
":first-letter" rather than ":first-char". The first letter of P has no
offspring so EM would never match, even if the draft did not state that
"pseudo-elements may only appear as the last segment of a selector".

David Perrell
Received on Wednesday, 17 December 1997 19:29:26 UTC

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