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

Re: pseudo-elements and *

From: Bert Bos <bert@w3.org>
Date: Sun, 5 Nov 2000 18:15:34 -0800 (PST)
To: Ian Hickson <ianh@netscape.com>
Cc: fantasai <fantasai@escape.com>, www-style@w3.org
Message-ID: <14854.4775.903903.245456@meta.inria.fr>
Ian Hickson writes:
> On Sat, 4 Nov 2000, fantasai wrote:
> 
> > Does the universal selector (*) apply to pseudo-elements?
> 
> No, the universal selector does not match pseudo-elements.
> 
> > example - given the following
> > 
> > p::first-line {color: red}
> > * {color: black !important}
> > 
> > Will the first line of each <p> be red or black?
> 
> Red, since the universal selector did not match and so the inherited black
> would be overriden by the red.
> 
> To explicitly style every possible part of a document in CSS3, you must
> use the following selector (assuming only CSS2 pseudos):
> 
>    *|*, *|*::before, *|*::after, *|*::first-line, *|*::first-letter

Assuming there is no default namespace declared, you can also write

    *, *::before, *::after, *::first-line, *::first-letter

or even

    *, ::before, ::after, ::first-line, ::first-letter

which looks a lot less like ASCII art :-)



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Monday, 6 November 2000 01:21:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:06 GMT