Home » CSS » CSS Introduction » Question
  1. Which of the following selector is used to selects the element that is the nth child of its parent?
    1. :last-of-type
    2. :first-of-type
    3. :nth-child(n)
    4. ::first-line
    5. None of these
Correct Option: C

div:nth-child(2) {background-color: red;}
/* sets the background color to red if the div is its parent’s second child */



Your comments will be displayed only after manual approval.