It probably is a specificity priority order that I dont get.
Here is the html code:
<div class="side-panel__item side-panel__item-active">
<p>Client Statistics</p>
<div class="side-panel__sub-container">
<p class="test">Option 1</p>
<p class="test">Option 2</p>
</div>
</div>
And the css code:
.side-panel__item-active {
color: orange;
text-decoration: underline;
}
.test {
color: #444;
text-decoration: none;
}
Expected behavior was that the text-decoration in .test would override the text:decoration inherited from .side-panel__item-active.
But it doesnt. The color on the other hand is changing fine.
I want to understand what is happening here. I would assume specificity order and the parent div having 2 classes but then again, why one declaration works ( color: #444 ) and the other doesnt?
.test overrides the color but not the text-decoration. What am I missing?