W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS3 Selectors - :root

From: ACJ <ego@acjs.net>
Date: Thu, 17 Feb 2011 14:10:21 +0100
Message-ID: <4D5D1E3D.7070005@acjs.net>
To: Karl Brightman <karl@karlbright.org>
CC: "www-style@w3.org" <www-style@w3.org>
Op 17-2-2011 4:10, Karl Brightman schreef:
> Hi,
> I have just discovered what I believe to be a bug with the way the 
> :root pseudo class has been implemented.
> The specification states the following about this pseudo-class selector:
> /
> "The :root pseudo-class represents an element that is the root of the 
> document. In HTML 4, this is always the HTML element."/
> What it does not describe is where the :root can be used, from what I 
> have tried, it only works when used at the beginning of a selector.
> /":root p.test { color: red; }"/
> However the following does not work:
> /"p.test :root body { background: red; }"/
> Am i missing something here or is this something that has not yet been 
> addressed? I was hoping to be able to use the :root pseudo class to 
> adjust styled based on whether or not an element can be found within 
> the document.

Hello Karl,

The rule you discribe, though valid, is never matched. Wat it does is 
look for a root element that is a child of something else. That's a 
contradictio in terminis.


Received on Thursday, 17 February 2011 13:10:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC