Advertisement:

Author Topic: Override visited link color  (Read 381 times)

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY
Override visited link color
« on: June 30, 2020, 05:30:20 PM »
Trying to change visited link color in html included in post.  Can it be done inline?

Online Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,240
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Override visited link color
« Reply #1 on: June 30, 2020, 05:37:26 PM »
Try something like with !important?

Code: [Select]
.whatever a {

color:#fff !important;
}

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY
Re: Override visited link color
« Reply #2 on: June 30, 2020, 05:56:54 PM »
Got this far -

Code: [Select]

[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?

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY
Re: Override visited link color
« Reply #3 on: June 30, 2020, 06:21:47 PM »
Crap, it's because FF doesn't allow a:visited for security reasons.  Works in IE.


Online Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,240
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Override visited link color
« Reply #4 on: June 30, 2020, 06:36:50 PM »
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;
}

Online Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,240
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Override visited link color
« Reply #5 on: June 30, 2020, 06:40:46 PM »
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?

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY
Re: Override visited link color
« Reply #6 on: June 30, 2020, 06:44:40 PM »
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.