W3C home > Mailing lists > Public > www-style@w3.org > March 2001

Re: css3 :nth-child() WD

From: fantasai <fantasai@escape.com>
Date: Thu, 01 Mar 2001 00:12:13 -0500
Message-ID: <3A9DDA2D.73891BB6@escape.com>
To: www-style@w3.org
Jonas Sicking wrote:
> 
> I propose the following synax instead
> :nth-child(an+b to c)
> That would allow the following selectors
>
> :nth-child(2n+1) /* every odd child */
> :nth-child(4n) /* every fourth child child */
> :nth-child(5n+2 to 3) /* child number 2,3,7,8,12,13.... */
> :nth-child(10 to 20) /* child 10,11...20 */
> :nth-child(5n+0 to 4) /* selects every child */
> :nth-child(2n+3) /* every odd child */

I like this.

As has been mentioned before, this functionality is very useful
for e.g. grouping table rows in sets of five.

You could also have the syntax like this -
:nth-child(an + b..c)
but that's just cosmetics.

> where a, b and c must be positive or zero

I don't think that's necessary. b < c should suffice.


But if you're disallowing the negative a, then IMO, you should
allow them and get rid of :nth-last-child instead. ;-)
Received on Thursday, 1 March 2001 00:11:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:08 GMT