首页 > 解决方案 > 为什么将标签的已访问伪类应用于未访问的链接?

问题描述

为什么访问之前的链接已经有紫色?你能解释一下为什么会这样吗?下面我提供HTML代码。

<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
  color: green;
}

/* visited link */
a:visited {
  color:purple;
}

/* mouse over link */
a:hover {
  color: red;
}

/* selected link */
a:active {
  color: yellow;
} 
</style>
</head>
<body>

<p>Mouse over and click the link: <a href="https://xjedi.com/index.jsp?com=ob&id=8271">XJEDI</a></p>

</body>
</html>

我有 Jsfiddle 的链接

标签: htmlcsstagspseudo-class

解决方案


推荐阅读