Re: css3 :nth-child() WD

Thanks for the feedback Jonas.

From: "Jonas Sicking" <sicking@bigfoot.com>
Date: Wed, Feb 28, 2001, 1:55 PM

> However I think the synax isn't very easy to read and also requires three
> psudos to match "child 3 to 5":
> :nth-child(-n+5):not(:nth-child(-n+2))

Just a quick correction on this, you actually only need _two_ pseudos:

 :nth-child(n+3)   /* this selects children 3 onward */

 :nth-child(-n+5)  /* this selects children before 5 inclusive */

Thus:

 :nth-child(n+3):nth-child(-n+5)  /* selects children 3 to 5  */

I think this is fairly easy to read, and the even follows the logical
semantic order of

 "starting at child 3", and "select up through child 5"
  (the first psuedo)         (the second pseudo)

Thanks,

Tantek

----------------------------------------------------------------------------
It is not the spoon that bends, it is only yourself.   microsoft.com/mac/ie/

Received on Wednesday, 28 February 2001 18:19:08 UTC