Re: pseudo-elements and *

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 UTC