So we have the following example about not()
and p:first-child{}
selectors.Here is the example:
<!DOCTYPE html>
<html>
<head>
<style>
p:first-child{
color: red;
}
p:not(a){
color: green;
}
</style>
</head>
<body>
<p>This a paragraph.</p>
</body>
</html>
Why the paragraph is red at the end? Can somebody explain (if possible ) why the p:first-child{}
has bigger specificity than not()
selector???