Chrome 在设置 a:visited css 属性时有问题吗? [英] Does Chrome have issue with setting a:visited css properties?

查看:30
本文介绍了Chrome 在设置 a:visited css 属性时有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将 :visited 超链接的背景颜色设置为不同的背景颜色.

I am unable to set the background color for a :visited hyperlink to a different background-color.

这是 Google Chrome 的已知问题吗?我见过有人用背景图片提出类似的问题.设置颜色属性似乎工作正常.

Is this a known issue for Google Chrome? I have seen people raising similar issue with background-image. Setting the color attribute seems to be working fine.

这是我使用的代码:

a:visited{
    background-color: red;
}

推荐答案

改为使用以下内容:

a {
   background-color: white;
}

a:visited{
    background-color: red;
}

出于安全原因——特别是为了防止历史嗅探——Chrome 非常严格地限制了使用 :visited 选择器可以执行的操作.

For security reasons -- specifically, in order to prevent history sniffing -- Chrome limits very strictly what can be done using the :visited selector.

这篇关于Chrome 在设置 a:visited css 属性时有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆