ควิซ 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 และ streak

ตัวอย่างคำถาม

ข้อ 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, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง