[英]text decoration line-through for visited links
I tried different variations of this code fo Stylish:我为 Stylish 尝试了此代码的不同变体:
a:visited {
text-decoration: line-through;
}
What i need to do for "line-through" visited links?我需要为“直通”访问的链接做什么?
I found this by using addEventListener("click"...)
我通过使用
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.编辑:由于用户的隐私问题,警告
text-decoration
样式是不允许的。
src: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector来源: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector
Limits to visited link styles限制访问链接 styles
You can style visited links, but there are limits to which styles you can use.您可以设置已访问链接的样式,但您可以使用的 styles 是有限制的。 Only the following styles can be applied to visited links:
只有下面的 styles 可以应用于访问过的链接:
color颜色
background-color背景颜色
border-color (and its sub-properties)边框颜色(及其子属性)
column-rule-color列规则颜色
outline-color轮廓颜色
The color parts of the fill and stroke attributes填充和描边属性的颜色部分
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.