cssselect icon indicating copy to clipboard operation
cssselect copied to clipboard

Support :nth-child(An+B of S)

Open redapple opened this issue 7 years ago • 1 comments

The current CCS 4 draft has :nth-child(An+B [of S]? ), extending :nth-child(An+B)

The :nth-child(An+B [of S]? ) pseudo-class notation represents the An+Bth element that matches the selector list S among its inclusive siblings. The CSS Syntax Module [CSS3SYN] defines the An+B notation. If S is omitted, it defaults to *.

By passing a selector argument, we can select the Nth element that matches that selector. For example, the following selector matches the first three “important” list items, denoted by the .important class: :nth-child(-n+3 of li.important)

redapple avatar Mar 15 '17 17:03 redapple

:nth-child(An+B [of S]? ) seems to have replaced :nth-match(An+B of <selector>) found in earlier versions of CSS4.

redapple avatar Mar 15 '17 17:03 redapple