🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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>?

  1. A.ul li
  2. B.ul > li
  3. C.ul + li
  4. 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 →