html - Does the :not pseudo class increase the specificity of a selector? -


i have read on css tricks :not should not add additional specificity. looks does?

https://css-tricks.com/almanac/selectors/n/not/

the specificity of :not pseudo class specificity of argument. :not() pseudo class not add selector specificity, unlike other pseudo-classes.

or missing something?

.red:not(.blue) {    background: blue;  }    .red {    height: 100px;    width: 100px;    background: red;  }
<div class="red">  </div>

yes, adds specificity of argument. @ first sentence:

the specificity of :not pseudo class specificity of argument. :not() pseudo class not add selector specificity, unlike other pseudo-classes.

so specificity of .red:not(.blue) equal of .red.blue — 2 class selectors, or (0, 2, 0), making more specific .red on own. second sentence means :not() itself not contribute additional specificity of pseudo-class make (0, 3, 0), :hover in .red.blue:hover example.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -