I have two different type of class names. The first are named color-*
. For example:
color-red
color-blue
color-green
I also have class names hover-color-*
hover-color-red
hover-color-blue
hover-color-green
I am attempting to make a css rule for the default hyperlink color:
a:not([class*='color-']) {
color: #3498db;
}
This is fine, however if a hyperlink exists like this:
<a href="#" class="hover-color-green">Link</a>
In this instance, the hyperlink should keep the default hyperlink color and only the hover color should be overridden, however because of the rule class*='color-'
and the fact I only specified the hover color, the hyperlink is not given a normal color (#3498db).
Is there any way to update this rule so that it only triggers if the class name begins with color-
? (so, ANYTHING-color-
would not apply)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…