开发者

CSS color of anchor element?

开发者 https://www.devze.com 2022-12-17 13:36 出处:网络
Please refer to the image at: http://i50.tinypic.com/svgg2h.jpg I have defined CSS color(#000000) for my anchor tag inside a ta开发者_如何转开发ble.

Please refer to the image at:

http://i50.tinypic.com/svgg2h.jpg

I have defined CSS color(#000000) for my anchor tag inside a ta开发者_如何转开发ble. But that color is overriden by the color value of #content (#50922c) . How can I solve this problem?


Prepend #content: #content table.grid thead tr.navigation td div.navigator a {}

Selectors with ids in them have higher precedence than those without. The anchor is selected by both of those rules, so make the second one just like the first, but with more detail, adding greater specificity, and thus greater precedence.

See the CSS specification on specificity to see how precedence is calculated.


Try this:

<style>
  .mycolor {color:#000000 !important};
</style>

<a href="whatever.html" class="mycolor">Hello There</a>

The !importnat declaration overrides all css rules with current one.

0

精彩评论

暂无评论...
验证码 换一张
取 消