Chrome在设置a:visited CSS属性方面是否存在问题? [英] Does Chrome have issue with setting a:visited css properties?

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

问题描述

我无法将:visited超链接的背景色设置为其他背景色.

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

这是Google Chrome浏览器的已知问题吗?我见过有人提出与背景图像类似的问题.设置color属性似乎工作正常.

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;
}

推荐答案

相反,请使用以下内容:

Instead, use the following:

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天全站免登陆