← Quiz: CSS Basics: all 10 questions
Quiz: CSS Basics · Question 7 of 10
Which selector matches only <li elements that are direct children of a <ul?
Which selector matches only <li> elements that are direct children of a <ul>?
- A.ul li
- B.ul > li
- C.ul + li
- D.ul, li
Answer & explanation
Correct answer: ul > li
is the child selector; a space would match any depth.
Can you get the rest right without peeking?
Take the timed Quiz: CSS Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →