Quiz de 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.

Media 10 preguntas ~6 minutos Se aprueba con 80%

Elige un modo

Juegas como invitado: inicia sesión para guardar tu XP y tu racha.

Pregunta de ejemplo

Pregunta 1 de 10

Which code declares a custom property and uses it correctly?

Ver la respuesta

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.

Qué cubre este quiz

  • 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

Preguntas frecuentes

¿Necesito una cuenta?

No. Cualquiera puede jugar. Inicia sesión para guardar tu XP, racha, insignias e historial.

¿Puedo repetirlo?

Sí. Se guarda tu mejor puntuación, y las preguntas y respuestas se mezclan cada vez.