← 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?
- A.@media (dark-mode: on)
- B.@media (prefers-color-scheme: dark)
- C.@media (theme: dark)
- 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 →