无法更改已访问的内容:before伪元素 [英] Cannot change the content of visited :before pseudo-elements

查看:103
本文介绍了无法更改已访问的内容:before伪元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为访问过的链接添加一些效果,然后我遇到这个问题。

I was trying to add some effects for visited links, then I got this problem.

这是代码: http://dabblet.com/gist/5447894

只有Opera可以成功更改内容的:before 伪元素。所有其他浏览器都失败。我错过了什么吗?感谢

Only Opera can successfully change the content of :before pseudo-elements. All other browsers are fail. Did I miss anything? Thanks

推荐答案

访问过的链接的允许(=未忽略)CSS属性是 color background-color border - * - color / code>和 column-rule-color (在某些情况下更多)。

The allowed (= not ignored) CSS properties of visited links are color, background-color, border-*-color, outline-color and, column-rule-color (more under certain circumstances).

防止历史窃取攻击。有关详情,请参见本文

This is to prevent history stealing attacks. See this article for further details.

因此,您可以在技术上为:visited 链接设置:之前伪类,忽略并且看起来好像未访问链接。这不是一个错误,它是一个功能;)

So you can, technically, set a :before pseudo class for :visited links, but it will be ignored and appears as if the links are not visited. This is not a bug, it's a feature ;)

这篇关于无法更改已访问的内容:before伪元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆