Problem Statement
Which is the correct syntax to define and use a CSS variable?
Explanation
CSS variables are defined with `--name` inside a selector (commonly `:root`) and accessed using `var(--name)`. They allow consistent theming and easier maintenance.
Code Solution
SolutionRead Only
:root { --main-color: #007bff; } h1 { color: var(--main-color); }Practice Sets
This question appears in the following practice sets:
