Custom Properties (Variables) — Quiz

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
How do you define a CSS custom property?
A $brand: #FF6B00;
B --brand: #FF6B00;
C var brand = #FF6B00;
D @brand: #FF6B00;
Question 2
How do you use a variable's value?
A use(--brand)
B var(--brand)
C $brand
D get(--brand)
Question 3
Where do you define global variables available everywhere?
A body only
B The :root selector
C Inside every element
D In the HTML head
Question 4
What is the main benefit of using variables for your brand colour?
A It loads faster
B Change it in one place and everywhere using it updates
C It hides the colour
D It only works in dark mode
Question 5
What does var(--accent, #FF6B00) do if --accent is not defined?
A Causes an error
B Uses the fallback #FF6B00
C Uses black
D Ignores the rule