【发布时间】:2019-10-23 17:56:52
【问题描述】:
我正在尝试 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。似乎颜色是级联的,文本装饰不是。 有人可以解释一下吗?
【问题讨论】:
标签: html css pseudo-class