Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我a:visited在 CSS 中使用了伪类。问题是当我刷新页面时,链接仍然保持红色,所以它们不会变成“未访问”,也就是说再次变成蓝色。这正常吗?我能做点什么吗?
a:visited
首先:欢迎!
:visited伪类标记用户浏览历史中访问过的每个链接。这意味着,即使在您重新加载页面后,链接仍会保持“已访问”状态。一个例子是谷歌搜索,访问的链接是紫色的。它们仅在清除浏览历史记录时变回。
:visited
这可能对您没有帮助,因为您没有提供有关您的环境的任何详细信息,但您可以尝试使用:activeor:focus伪类。
:active
:focus