🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: CSS Variables and Animations: all 10 questions

Quiz: CSS Variables and Animations · Question 4 of 10

Which media query lets a site follow the operating system's dark mode setting?

Which media query lets a site follow the operating system's dark mode setting?

  1. A.@media (dark-mode: on)
  2. B.@media (prefers-color-scheme: dark)
  3. C.@media (theme: dark)
  4. D.@media screen and (color: black)
Answer & explanation

Correct answer: @media (prefers-color-scheme: dark)

prefers-color-scheme reports the user's light or dark preference.

Can you get the rest right without peeking?

Take the timed Quiz: CSS Variables and Animations quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →