W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: selector negation (was Re: New version of the Selectors module of CSS3)

From: fantasai <fantasai@escape.com>
Date: Tue, 10 Oct 2000 19:39:39 -0400
Message-ID: <39E3A8BB.74D13DBC@escape.com>
To: www-style@w3.org
Matthew Brealey wrote:
 | Precisely one argument - one simple selector. Cause !:first-child is
 | not as nicely wrapped up as :!(:first-child). I did consider :not(),
 | but I preferred the briefer syntax.

Is it possible to get rid of the first colon? The two colons seem redundant,
and, as has been pointed out before, negation is not a pseudo-class in 

Actually, using a single symbol makes it very easy to adapt the syntax
for all the selections:

!(P) > A

Or if you'd rather not have parentheses:

!P > A

Although, if one wants to get complicated, the parentheses can add powerful
grouping capabilities:

!(DIV.navbar > P) > A

Not to mention they add clarity in terms of the negation's scope whether
or not any grouping is allowed: !P.blurb could mean !(P).blurb or !(P.blurb)
unless you paid close attention to syntax rules & language allowances.

One problem with using ! is that it's used for !important, which does
/not/ mean "not important".

Received on Tuesday, 10 October 2000 19:39:29 UTC

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