QuestenaПрактика, после которой понятно, что повторить
Вопрос 3

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

  1. (1, 2, 2)Правильный ответ
  2. (1, 1, 2)
  3. (1, 3, 2)
  4. (1, 2, 3)

Объяснение

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.

Продолжить работу с тестом

Начать тренировку
Вопрос 3: What is the specificity of the selector below, written as… · CSS Fundamentals Readiness Check · Questena