:nth-child(n)
Term side of the Card
Topic: Pseudo Classes
Unit title: :nth-child(n)
Categories: Pseudo-class
Explanation side of the Card
Explanation: The pseudo-class that selects elements based on their position in a parent element's child list, using a formula 'n'. It allows styling elements based on their order, such as every third element ('3n') or the second element ('2n'), using various expressions like 'odd', 'even' or specific numbers.
Browser compatibility:
- The chrome browser supports this feature starting from version 1
- The edge browser supports this feature starting from version 12
- The firefox browser supports this feature starting from version 3.5
- The safari browser supports this feature starting from version 3.1
Availability: