What is :nth-child
?
:nth-child
— is a pseudo-class that allows you to select elements by their sequence number. For example, you can select the fifth paragraph and apply the necessary styles to it, or select all even-numbered rows in a table and make it striped.
In this tutorial, we will go through the mechanism of this selector in detail. Let’s start with the initial html markup. We will work with a regular list.