Intermediate HTML & CSS
Q69 / 100

What is the purpose of CSS custom properties (variables), e.g. "--main-color: #336699;" used as "color: var(--main-color);"?

Correct! Well done.

Incorrect.

The correct answer is B) They allow defining reusable values that can be referenced throughout a stylesheet (and updated dynamically via JavaScript or media queries), reducing repetition and enabling theming

B

Correct Answer

They allow defining reusable values that can be referenced throughout a stylesheet (and updated dynamically via JavaScript or media queries), reducing repetition and enabling theming

Explanation

CSS custom properties are native to CSS (no preprocessor required), can cascade and be scoped, and can be read/updated at runtime via JavaScript, enabling dynamic theming.

Progress
69/100