0
What is nth-child
2 Answers
+ 10
Nth-child is simply used to apply styling to a specific child of a parent element.
For example,
HTML :
<div class="parent">
<div class="child"></div>
<div class="child"></div>
</div>
CSS :
. parent :nth-child(2) {
color: blue;
}
Doing that will style the second div which is a child of the .parent div
https://www.w3schools.com/cssref/sel_nth-child.asp