Consider the following
.pr a { color: green; }
a:link { color: red; }
<p class="pr">
Welcome, please <a href="#">login</a>
</p>
On what rule does the above code follow such that the link gets the red color?
From the above code
- Both are author styles i.e same origin
- None is !important
- None is inline
- Selector specificity (Here)
I used number of (id's, classes, tags)
notation
.pr a
-> (0,1,1)
a:link
-> (0,0,1)
So from my understanding .pr a
should have won. What am i getting wrong?