What is the level of CSS specificity obtained by inherited properties? I read the W3 recommendation regarding CSS specificity, and therefore I understand how to calculate the various features of CSS rules that directly target the same element, but I don’t see any mention of the level of specificity set for the inherited attributes.
In particular, the problem I am facing is related to header elements, although it would be very interesting for me to understand this as a whole.
For example, here is an HTML snippet:
<h2>This should be black</h2>
<div class="all_red_text">
<h2>This should be red</h2>
</div>
Now, if I include some CSS like this:
.all_red_text { color: red; }
I will get the expected result. On the other hand, if I css, which I included was
h2 { color: black; }
.all_red_text { color: red; }
. CSS , , , , .