Home » CSS » CSS Attribute Selectors » Question
  1. Which of the following selector selects an element if it’s the only child of its parent?
    1. :nth-oftype(n)
    2. :only-child
    3. :root
    4. All of above
    5. None of these
Correct Option: B

Example: h1:only-child {color: blue;}



Your comments will be displayed only after manual approval.