开发者

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

开发者 https://www.devze.com 2023-03-20 18:55 出处:网络
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-ima

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{
    backgroun开发者_JAVA技巧d-color: red;
}


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消