颜色已被覆盖,但在CSS中却是文字修饰]

问题描述 投票:0回答:2
我正在尝试在CSS中为锚标记添加伪代码,即链接,已访问,悬停并处于活动状态。的HTML是:

<a href="https://www.w3schools.com/html/" target="_blank"> w3school </a>

css是:

a:link { color: blue; text-decoration: overline underline; } a:visited { color: green; text-decoration: line-through; } a:hover { color: red; text-decoration: underline; } a:active { color: black; text-decoration: overline; }

被访问后,文本颜色为绿色,这是正确的。但是,文本修饰是上划线和下划线,而不是line-through :visited is partially working。看来颜色是级联的,而文字装饰不是。有人可以解释一下吗?

我正在尝试在CSS中为锚标记添加伪代码,即链接,已访问,悬停并处于活动状态。 html是: w3school

html css pseudocode
2个回答
0
投票
[如今,浏览器限制了您可以为:visited状态使用的样式-否则,通过JavaScript检查布局的某些更改可以确定您是否已经访问了外部URL。

-1
投票

文字修饰

© www.soinside.com 2019 - 2024. All rights reserved.