Home > front end >  NTH - child
NTH - child

Time:12-01

Structure pseudo class selector NTH - child (n + 2) and the NTH - child (2 + n) is the difference? The latter is what is invalid

CodePudding user response:

NTH - child (n) "option is used to locate a parent of one or more specific child element
The "n" is its parameters, and can be an integer value (1, 2, 3, 4), can also be expression (2 n + 1, n + 5) and keywords (odd, even), but the parameters n the starting value is always 1, not 0, that is to say, the value of the parameter n is 0, the selector will choose less than any of the matched elements,

CodePudding user response:

https://developer.mozilla.org/zh-CN/docs/Web/CSS/:nth-child
Format requirements
  • Related