Reputation: 23989
I am using Bootstrap3 glyphicons. e.g.
<i class="glyphicon glyphicon-cog" title="Edit"></i>
I want it to be green so I use a class called public which is:
.public {
color:green;
}
When I apply this to the icon it does not work. It stays gray.
<i class="glyphicon glyphicon-cog public" title="Edit"></i>
Yet if I apply the style inline it works:
<i class="glyphicon glyphicon-cog" style="color:green" title="Edit"></i>
Why is that?
Upvotes: 1
Views: 412
Reputation: 2105
my best guess is there is an existing style more specific than your .public selector
try this:
.public {
color:green !important;
}
to override the existing style - and give a google about css specificity - ill grab a link in a second for you
check out that article for how css determines 'importance' of which styles it should apply ^ ^ ^
Upvotes: 2