I have some html anchor link code, and unlike the rest of document I want it to look like it is not a link.
Is there a simple way to disable the style change caused by wrapping text in a anchor tag without having to brute force it to be the same (ie, if I change the body font style I don't have to also change some other :link stuff).
Setting color to black and text-decoration to explicitly none is a little more aggressive than worked for me.
I was looking for the CSS of the anchors to be "benign" and just blend into the existing CSS. Here's what I went with:
Then I just added the CSS nostyle class to the anchors that I wanted to be unformatted.
If you don't care about IE, you can attach
:not(#exclude)
(whereexclude
is the ID of the link in question) to your link styles:Otherwise I don't think you can brute-force it the way you describe. You can either use an inline style instead (not recommended) or you can use a special class/ID assigned to that link, whose selector you'd group with
body
. For example, if you had these styles:You can simply toss in a more specific selector, that'd match that link, onto the
body
rule:I achieved this by creating a class
.reset-a
and targeting all of its' pseudo classes.Targeting of all pseudo classes is important to make it flawless.
outline: 0
property removes the dotted border that surrounds a link when it is focused or active.