Does Chrome have issue with setting a:visited css properties?

我的未来我决定 提交于 2019-12-19 07:44:54

问题


I am unable to set the background color for a :visited hyperlink to a different background-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.

This is the code that I used:

a:visited{
    background-color: red;
}

回答1:


Instead, use the following:

a {
   background-color: white;
}

a:visited{
    background-color: red;
}

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




回答2:


Sounds like this is unsupported for security reasons, and will be in Firefox too, as detailed in this answer.



来源:https://stackoverflow.com/questions/6727993/does-chrome-have-issue-with-setting-avisited-css-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!