Question 9 of 10Pro Only

What are CSS custom properties, also known as CSS variables, and how do you use them?

Sample answer preview

CSS custom properties, commonly called CSS variables, let you define reusable values in your stylesheets. They reduce repetition and make themes easier to manage. Define a custom property with two dashes prefix: :root { --primary-color: #3498db; --spacing: 16px; } :root targets…

CSS variablescustom properties--var():roottheming

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Frontend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime