Re: limitation proposal of :nth-child

On 9/17/14, 8:46 AM, Célian Veyssière wrote:
> Currently it is not possible to make all elements 1 to 10 on list with a
> selector.

   :nth-child(-n+10)

This is explicitly called out in the spec at 
<http://www.w3.org/TR/css3-selectors/#nth-child-pseudo>; search for "The 
value a can be negative".

> - :nth-child(n in (1 to 10))

:nth-child(-n+10)

> - :nth-child(n in (1 to 10, 12 to 15))

:matches(:nth-child(-n+10), :not(:nth-child(-n+11)):nth-child(-n+15))

Granted, that's getting a bit complicated.

-Boris

Received on Wednesday, 17 September 2014 16:51:57 UTC