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와 연속 기록이 저장돼요.

예시 문제

10문제 중 1번

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, 연속 기록, 배지, 기록이 저장돼요.

다시 풀 수 있나요?

네. 최고 점수가 저장되고, 문제와 보기는 매번 섞여서 나와요.