I already have this code in my style.css (using wordpress):
a:link, a:visited {
color: #3088FF;
text-decoration: none;
}
I want to change the anchor text color, font style, bold etc for categories. How can I override this?
I already have this code in my style.css (using wordpress):
a:link, a:visited {
color: #3088FF;
text-decoration: none;
}
I want to change the anchor text color, font style, bold etc for categories. How can I override this?
If you must overwrite existing styles, use the !important
declaration. For example,
.myStyledLink{
color: #FFF !important;
}
Assuming you mean the anchor has inline style already that you wish to override with CSS, use the !important
keyword:
<a href="#" style="color: red;">hello</a>
CSS:
a:link, a:visited {
color: #3088FF !important;
text-decoration: none;
}
This will override all other styles including inline style and if you are worried about cross browser compatibility then you shouldn't: What browsers support "!important"?
Identify the ID of the categories widget in your output HTML. Let's say that id="widget-cat"
, then create a CSS rule as follows to override the link colours within that widget, e.g.
#widget-cat a:link, #widget-cat a:visited {
color: #FFF;
}
The use of !important
is a very last resort to overriding styles really, and I recommend only ever using that if you need to override CSS rules that can't be made more specific and were written by third-party developers that you have no control over.