I stumbed upon this case. I'm not trying to resolve it, I just want to understand the cause.
I have this HTML (I cannot change the HTML in this project) :
<span class="cat-title title">
<h2>
<span>
Partie membre
</span>
</h2>
</span>
And this CSS :
.cat-title h2 span {
font-size: 11px;
}
.cat-title h2 {
font-size: 50pt !important;
}
What I'm expecting :
The text should be 50pt since I used !important
, not 11px.
The result I'm getting : The text is 11px.
I thought it was because .cat-title h2 span
was more specific, but I don't think it makes sense : !important
is meant to rule over all the other CSS rules.
Why is that ? What is the reason behind that ?
Thank you !