-2

I tried different variations of this code fo Stylish:

a:visited {
    text-decoration: line-through;
}

What i need to do for "line-through" visited links?

1 Answers1

0

I found this by using addEventListener("click"...)

document.getElementById("link1").addEventListener("click",function(){
document.getElementById("link1").style.textDecoration = "line-through";
});

document.getElementById("link2").addEventListener("click",function(){
document.getElementById("link2").style.textDecoration = "line-through";
});
<a href="#" id="link1">Link 1</a>
<a href="#" id="link2">Link 2</a>

EDIT: Warning text-decoration styling is not permitted due to the user's privacy issues.

src: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector

Limits to visited link styles

You can style visited links, but there are limits to which styles you can use. Only the following styles can be applied to visited links:

  • color

  • background-color

  • border-color (and its sub-properties)

  • column-rule-color

  • outline-color

  • The color parts of the fill and stroke attributes

zerbene
  • 1,249
  • 2
  • 7
  • 21