W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: proposal for a new css combinator

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Jan 2010 18:01:08 -0600
Message-ID: <dd0fbad1001141601w4cec3f87k1d411ef16a508af4@mail.gmail.com>
To: James Elmore <James.Elmore@cox.net>
Cc: Alan Gresley <alan@css-class.com>, Niels Matthijs <niels.matthijs@internetarchitects.be>, Aryeh Gregor <Simetrical+w3c@gmail.com>, www-style list <www-style@w3.org>
On Thu, Jan 14, 2010 at 12:53 PM, James Elmore <James.Elmore@cox.net> wrote:
> Does the specification for the (an+b) not include negative numbers? If I
> remember correctly, (-1) selects the last child. (If I am wrong, sorry. I
> will try to find time later today to check the spec and refresh my
> memories.)

Nope.  Elements are numbered 1,2,3….  Numbers less than 1 match no
elements at all.

(This is useful, as it means you can select, say, the first 3 elements
by using :nth-child(3-n) - it counts backwards from 3, and stops
selecting anything after it drops below 1.)

Received on Friday, 15 January 2010 00:02:01 UTC

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