Search within TutorialsPark

CSS Pseudo Class Selector :nth-child


Selects elements that are the nth child of their parent


Definition and Notes.

1. CSS Pseudo Class :nth-child selects and styles elements that are the nth child of their parents.

2. Eg: li:nth-child(3) will select third child element within the list, counting from top-bottom.


Pattern:

CSS :nth-childPseudo Class selector. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note: The value in brackets "n" can be a number, keyword or even a function(formula).


Related Examples.