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

[css3-selectors] Should pseudo-classes "of type" discriminate based on class selectors?

From: Eric Peterson <i.am@eric.pe>
Date: Mon, 12 Sep 2011 12:11:25 -0700
Message-ID: <CAJ8x=tbak8edWuom-d31QW=CtyL-Bg=92KGBUjuHgkN6kCkkxQ@mail.gmail.com>
To: www-style@w3.org
I think it makes sense for CSS3 pseudo-classes ending with "-of-type" (i.e.
nth-of-type, only-of-type, first-of-type, etc.) ought to take into account
not only their  elements, but also any class selectors attached to the
element.

i.e.

div > p:nth-of-type(2) {}

Would affect the second p directly descendant of div.  While on the other
hand...

div > p.foo:nth-of-type(2) {}

Would affect only the second p with class "foo" directly descendant of div.
Received on Thursday, 15 September 2011 07:20:26 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:44 GMT