Skip to content

[selectors-4] nth-child omits n=0 case #2321

@fergald

Description

@fergald

https://drafts.csswg.org/selectors-4/#the-nth-child-pseudo

"The An+B notation and its interpretation are defined in CSS Syntax 3 §6 The An+B microsyntax; it represents any index i = An + B for any positive integer n."

So e.g. 2n+1 would not match the 1st child.

The link is to

https://drafts.csswg.org/css-syntax-3/#anb-microsyntax

"The An+B notation defines an integer step (A) and offset (B), and represents the An+Bth elements in a list, for every positive integer or zero value of n, with the first element in the list having index 1 (not 0)."

The spec should mention the zero case (and probably also that the list is 1-indexed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions