What are :is and :where? This probably doesn’t make much sense in terms of how it helps us write shorter selectors, so let’s try using How to use :is and :where?:where() can help us solve problems like this .btn span > a:hover, #header span > a:hover, #footer span > a:hover { ...; } Become something like this :where(.btn, #header, #footer) span > a:hover { ...; } and :is() can help add the same to this example is(.btn, #header, #footer) span > a:hover { ...; } What is the difference between :isand :where? What is CSS specificity (in a nutshell)?There are four levels of specificity in CSS. Each level or category has a different score, and we can add up all the scores to calculate the specificity of the selector. The element with the highest number of selectors will have its styles applied to it, which is why sometimes when you write CSS, your styles won’t be applied and will show up as crossed out in the developer tools. Specificity rating score
For example button.btn { color: red; } .btn { color: green; } .btn = 10 button.btn = 1 + 10 = 11 If we put the As you can see, there are two different levels of specificity for pseudo-classes. This is because different pseudo-classes can have different levels of specificity, depending on which pseudo-classes you use and how you use them. This is the end of this article about what the newly added CSS :where and :is pseudo-class functions are. For more relevant CSS :where and :is pseudo-class function content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: SQL query for users who have placed orders for at least seven consecutive days
>>: Vue elementUI implements tree structure table and lazy loading
Usage of alter command in mysql to edit table str...
Result:Implementation code: html <link href=...
This article example shares the specific code of ...
1. Front-end-led implementation steps The first s...
Table of contents 1. Troubleshooting and locating...
These specifications are designed to allow for bac...
getElementById cannot get the object There is a s...
Table of contents What is a skeleton screen How t...
1. Add the viewport tag to the HTML header. At th...
1. Function: xargs can convert the data separated...
Background-image is probably one of those CSS pro...
Design the web page shown above: <!DOCTYPE htm...
1 Problem Description This article sorts the esta...
Table of contents Union query 1. Query the ID and...
Method 1: Use Google advanced search, for example...