Loading tutorials
:is() matches, where you ca5 min read:is() in the previous chapter.4 min read:is() and :where() match a list of alternatives. The only thing that separates the 5 min read:is() and :where() from the earlier chapters. Here you apply them to 5 min read:is() and :where() and know the key difference: :is() takes the specificity of its most specific argument, and `:5 min read:is() and :where() match the same elements and differ only in the specificity they contribute. The goal here is to turn that 6 min read:is() and :where() as ways to match alternatives. Here you will learn what happens when one item in the list is invalid5 min read:is() and :where() shorten selectors, and the earlier chapters showed where they help. This chapter covers where they stop working and where they surprise people. It assumes you know the following:4 min read:is() and :where() in the earlier chapters.5 min read:not() and :has() count toward specificity. It assumes you have read the chapters on :is() and :where(), so you know that :is() takes the specificity of its most specific argument and :where() contributes nothing. You should also be comfortable writing specificity4 min read:where() and cascade layers keep specificity from deciding a conflict. This chapter compares them and shows when to use each. It assumes you know the previous chapters: how :is() and :where() compute specificity, and why a :where() default is easy to override. It also assumes you can re5 min read:is() and :where(), what the older prefixed names were, and how to ship these selectors safely. It assumes you can already write :is() and :where() selectors, know how selector lists are dropped when one item is invalid, and understand specificity. 6 min read