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
This article example shares the specific code of ...
I recently used Docker to upgrade a project. I ha...
This article uses an example to describe the erro...
Preface Because this is a distributed file system...
Nexus provides RestApi, but some APIs still need ...
1. Create an empty directory $ cd /home/xm6f/dev ...
1. View the detailed information of all current c...
Preface After MySQL version 3.23.44, InnoDB engin...
Table of contents 1. Docker Image 2. Create an in...
Since the entire application needs to be deployed...
1. Installation process MySQL version: 5.7.18 1. ...
Configuration steps 1. Check whether DNS is confi...
In applications with paging queries, queries that...
The fixed IP address of the centos-DVD1 version s...
<br />Reading is a very important part of th...