ExamVeda
Login
Home
This question belongs to CSS CSS3 Fundamentals
CSS3 Fundamentals
?

Which of the following selector is used to selects the element that is the nth child of its parent?

Answer & Solution
Correct Answer: Option A
div:nth-child(2) {background-color: red;}
/* sets the background color to red if the div is its parent’s second child */
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.