Квиз по HTML & CSS: Custom Properties (CSS Variables)

This CSS quiz is about custom properties: declaring --name values, reading them with var(), and how they inherit and cascade. It also covers fallbacks, calc(), changing variables from JavaScript and registering them with @property.

Средний 10 вопроса ~6 минуты Проходной балл: 80%

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

Which code declares a custom property and uses it correctly?

Показать ответ

D. :root { --brand: #06c; } a { color: var(--brand); } Custom property names start with two dashes and are read with var(--name). The $ and @ forms belong to Sass and Less, not to plain CSS.

Что проверяет этот квиз

  • Declaring --name and reading it with var()
  • Fallback values and nested fallbacks
  • Scope, inheritance and case sensitivity
  • Invalid at computed-value time, and why variables do not work in media queries
  • calc() with variables, JavaScript setProperty() and @property

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.