Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a site-wide CSS that sets the colour for links. This works fine on IE, but in Chrome, the links have a purple colour that is almost invisible against my background.

Checking in Developer Tools, I see that my global colour is crossed out and instead the active rule is as follows:

CSS
a:-webkit-any-link { color: -webkit-link; }


I don't see why my rule isn't the one with the highest specificity. I thought default rules built into the browser had the lowest priority, but this one appears to be higher than my rule.

Does anyone have any idea what's happening here, and - more importantly - how I can fix it?

Kind wishes ~ Patrick
Posted

1 solution

Hi Patrick,

You could use this line in your css file
CSS
a:-webkit-any-link { color: -webkit-link !important; }

this will insist priority to the browser.
See this image[^]
Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v3
Comments
Patrick Skelton 17-Jan-14 9:21am    
Hi,

Thanks for the reply. Unfortunately, it doesn't appear to have any effect at all.

- Patrick
♥…ЯҠ…♥ 17-Jan-14 9:33am    
have you try the same in google chrome DOM? try adding this option in there and check it ;-)
Patrick Skelton 17-Jan-14 9:35am    
Sorry - I don't understand what you mean.
♥…ЯҠ…♥ 17-Jan-14 9:45am    
updated my solution
Patrick Skelton 17-Jan-14 9:58am    
Thanks for that. I tried adding it in there. When the new rule (as you have written it above) is active (has a tick), it changes another link in another part of the page to be the same purple colour as the link I am trying to 'fix'. Ticking and unticking the box next to the new rule has no effect on the link I am trying to fix.

(Sorry if this is unclear; it is a difficult thing to explain.)

- Patrick

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900