颜色:无; 替代

Jon*_*Jon 2 html css

我有一个链接,其文本颜色将通过或.light或应用.dark.此链接还有一个文本颜色,当它悬停在其上时,我无法删除样式(但我可以修改它).当用户将鼠标悬停在链接上时,我希望文本的颜色不会改变.

http://jsfiddle.net/nCt58/1/

<h2><a href="resume" class="light">Resume</a></h2>

a:hover { color:#ff0000; } //cannot remove this style
.light { color:#888; }
.dark { color:#000; }
Run Code Online (Sandbox Code Playgroud)

Ble*_*der 5

只需添加另一个选择器来覆盖a:hover:

.light, .light:hover { color:#888; }
Run Code Online (Sandbox Code Playgroud)

演示:http://jsfiddle.net/nCt58/4/