html css 访问过的链接
我的链接有时会变成紫色,可能是因为它们被访问过或者其他什么原因。我想从 css 中禁用它。
我该怎么做?
提前谢谢你可爱的亚历山大
my links turn purple sometimes, probably becouse they are visited or something. I want to disable this from css.
How can i do this?
thanks in advance, yours lovely alexander
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通过使用访问的伪类
by using the visited pseudo-class
只需设置一个 CSS 样式即可设置
标签的颜色。
a:link
、a:hover
、a:visited
和a:focus
有单独的伪标签,但除非它们在其他地方设置,否则您不需要指定它们 - 如果您只是如上所述指定a
的样式,则它应该应用任何元素的状态。如果正在设置伪样式并且您需要覆盖它们,那么您将需要类似这样的内容:(
当然您可以删除上面任何您不想覆盖的内容)
Simply set a CSS style which sets the colour for
<a>
tags.There are separate pseudo tags for
a:link
,a:hover
,a:visited
anda:focus
, but unless they're being set elsewhere, you shouldn't need to specify them - if you just specify the style fora
as above, it should apply whatever the state of the element.If the psedo styles are being set and you need to override them, then you'll need something like this:
(of course you can remove any of the above that you don't want to override)
您可以使用选择器 a:visited。
You can use the selector a:visited.
在CSS中写:
In CSS write:
您需要为链接定义访问属性。
You need to define the visited property for your links.