Квиз по HTML & CSS: Specificity & the Cascade

This CSS quiz is about the cascade, the algorithm the browser uses to choose one value when several rules set the same property. Expect tricky cases with specificity counting, source order, !important, inheritance, :is() and :where(), and cascade layers.

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

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

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

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

Вопрос 1 из 10

What color is the paragraph?

<style>
  #intro { color: red; }
  p.lead.big { color: blue; }
</style>
<p id="intro" class="lead big">Hello</p>
Показать ответ

B. red #intro has specificity (1, 0, 0) and p.lead.big has (0, 2, 1). Columns are compared left to right, so one id beats any number of classes.

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

  • Counting specificity as (ids, classes, types)
  • Source order when specificity ties
  • Inline styles and !important
  • Inherited values vs rules that target the element
  • :is(), :where(), :not() and @layer

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

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

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

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

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