QuestenaPractice that shows what to review next
Question 3

What is the specificity of the selector below, written as (ID, class, type)? #main ul li.item:not(.hidden)

  1. (1, 2, 2)Correct answer
  2. (1, 1, 2)
  3. (1, 3, 2)
  4. (1, 2, 3)

Explanation

One ID selector (#main) gives 1 in the first column. Two class selectors count in the second column: .item, plus .hidden, because the argument of :not() contributes its own specificity. Two type selectors, ul and li, give 2 in the third column — so (1, 2, 2). Answering (1, 1, 2) means forgetting that the argument inside :not() counts; answering (1, 3, 2) means counting :not() itself as a pseudo-class on top of its argument, which it is not.

Continue with this test

Start practice
Question 3: What is the specificity of the selector below, written as… · CSS Fundamentals Readiness Check · Questena