html - CSS :visited background image not applying?

标签 html css

我正在尝试获取“下载”链接上的背景图像,以便在单击并下载后更改为绿色勾号。我已经应用了 a:visited、a:hover 和 a:active,hover 有效,但不知何故 a:visited 和 :active 无效,有什么想法吗?

form.download a:visited{
background: url("../images/tick-active.png") no-repeat 10px 5px;       
}

form.download a:hover{
background: url("../images/tick-active.png") no-repeat 10px 5px;
}

form.download a:active{
background: url("../images/tick-active.png") no-repeat 10px 5px;
}

另外,这是一个 jsfiddle

最佳答案

它不起作用,因为某些浏览器将其视为侵犯隐私。

背景颜色应该可以。我猜背景图像是问题所在,因为您可以通过跟踪对服务器的图像请求来查看用户访问了哪些页面。

看这里:

background-image: for :visited links?

Google chrome a:visited background image not working

关于html - CSS :visited background image not applying?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22849008/

相关文章:

html - 如何将表格列宽设置为最长值(不包括标题)

php - Wordpress - 试图删除顽固的标题

html - 对齐按钮和 div 中的链接,在 IE 中损坏,在 FF 中有效

javascript - 如何避免谷歌折线图注释文本相互覆盖?

html - 跨度不适合另一个跨度

html - 取决于目标的下拉功能

css - 为各种屏幕尺寸设置相对于基本字体大小的字体大小

javascript - 如何在文本悬停时更改图片的属性?

javascript - jQuery 使用 $.load() 执行顺序异步问题(bootstrap modal)

html - 如何使表体占用的宽度小于表头的宽度