W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css3-selectors] Structural pseudo-classes and the root element.

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Wed, 13 Jun 2012 23:30:57 +0800
Message-ID: <4FD8B231.7040404@csail.mit.edu>
To: Simon Sapin <simon.sapin@kozea.fr>
CC: WWW Style <www-style@w3.org>
(12/06/13 23:22), Simon Sapin wrote:
> Namely, :nth-child, :nth-last-child, :nth-of-type, :nth-last-of-type,
> :first-child, :last-child, :first-of-type, :last-of-type, :only-child
> and :only-of-type are all based on the element having a parent. The root
> element is the only one without a parent, so I guess none of these
> pseudo-classes apply. But I don’t find this very clear in the spec.

  # The :nth-child(an+b) pseudo-class notation represents an element
  # that has an+b-1 siblings before it in the document tree, for any
  # positive integer or zero value of n, *and has a parent element*.

~ http://www.w3.org/TR/selectors/#nth-child-pseudo

I agree this is pretty hard to find.

Received on Wednesday, 13 June 2012 15:31:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC