The pseudo-class :________ is used to target elements that are the only child of its parent with a specific type.

  • first-of-type
  • last-child
  • only-child
  • only-of-type
The correct answer is 'only-child'. This pseudo-class selects elements that are the only child of their parent. It ensures that the style is applied to elements that are the sole child within their parent container, regardless of their element type.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *