Override visited link color

Started by Sir Osis of Liver, June 30, 2020, 05:30:20 PM

Previous topic - Next topic

Sir Osis of Liver

Trying to change visited link color in html included in post.  Can it be done inline?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Mick.

Try something like with !important?

.whatever a {

color:#fff !important;
}

Sir Osis of Liver

Got this far -



[html]
<!DOCTYPE html>
<html>
<head>
<style>
td {color: green; font-size: 10pt;}
td a:link {color: red !important;}
td a:visited {color: green !important;}
td a:hover {color: yellow !important;}
</style>
</head>
<body>

<table>



a:link and a:hover work, but a:visited doesn't. >:(

Maybe because it's an external link?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Crap, it's because FF doesn't allow a:visited for security reasons.  Works in IE.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Mick.

Hmmm.. I never use visited link colors. I just add the same color in all my themes. Couldn't tell you a reason why.

a:link, a:visited {
   color: #50527A;
   text-decoration: none;
}

Mick.

But in reality...

a:link {
color: #000;
}
a:visited {
color: #xyz;
}
a:hover {
color: #abc;
}

should work.... !important is the ticket unless something else is overwriting?

Sir Osis of Liver

No, it's a browser security thing, it's just not allowed.  I've never used :visited either, but I'm tinkering with an mp3 playlist (audio books), some of them are quite long, and I'd like users to be able to see which ones they've played.  There are some javascript workarounds, but nothing I'd mess with.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Gwenwyfar

That makes no sense though... It has been a default pseudo selector in all browsers for a long time.

Ps: I'm using Firefox.
"It is impossible to communicate with one that does not wish to communicate"

Kindred

a:visited  works just perfectly fine.

I don't know what you mean by a "browser security thing, it's just not allowed"

That is provably untrue on both FF and Chrome
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

It's ignored in FF, try it.  Found several references that stated visited links are easy to get from outside, so they're not allowed in some browsers for security reasons.  Did it a different way and works, so not a big deal.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Gwenwyfar

"It is impossible to communicate with one that does not wish to communicate"

Sir Osis of Liver

Will try it again in test script, but didn't work in straight html, all other pseudo-classes worked normally.  IIRC, IE11 changed visited links to purple regardless of a:visited color, FF did nothing.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Quote from: Kindred on July 15, 2020, 02:16:56 PM
a:visited  works just perfectly fine.

I don't know what you mean by a "browser security thing, it's just not allowed"

That is provably untrue on both FF and Chrome

Except it is a browser security thing, actually. It's possible for a page to work out your history based on making link tags, and querying the state of visited by having different colours - you can set them to be the same colour as unvisited links but you can't set them to different colours specifically because it was used as a profiling technique.

Gwenwyfar

I see. Where is that something you see? Even the default styling (before any css is added) gives different colors.
"It is impossible to communicate with one that does not wish to communicate"

Arantor

It's not where you *see* it, it's more that JavaScript queries for these details, and the default values are given to JavaScript as lies now.

Gwenwyfar

"It is impossible to communicate with one that does not wish to communicate"

Sir Osis of Liver

Actually, it does seem to work in some scripts, not in others.  Haven't had the patience to determine why.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: