Re: css3 :nth-child() WD

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 UTC