I have the following markup :
HTML
<article class="card big-number border-green">
<p class="number">5</p>
</article><!-- /card-two -->
CSS
article[class^='border-'], article[class*=' border-'] {
border-left : 1px solid ;
}
.border-yellow {
border-left-color: yellow;
}
.border-green {
border-left-color: green;
}
.border-blue {
border-left-color: blue;
}
.border-red {
border-left-color: red;
}
The issue is that the colors are not being applied, unless I specify element like so :
article.border-red {
border-left-color: red;
}
I know I can resolve it using a catch-all rule like
[class^='border-'], [class*=' border-']
but the reason for the question is that I would very much like to understand the REASON for that behavior. isn't 'border-color
' considered a rule for ANY element that contains this class ( including 'article'
in my case ..) and have a declared border property ?
Tested on Chrome, Firefox .