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

前端 未结 2 1043
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 04:37

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 p

相关标签:
2条回答
  • 2021-01-13 04:50

    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.

    0 讨论(0)
  • 2021-01-13 04:58

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

    0 讨论(0)
提交回复
热议问题