CSS伪类组合 [英] CSS pseudo class combinations

查看:161
本文介绍了CSS伪类组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设定锚定标记的样式,以便一旦链接被访问,它将变为红色,并将[旧]附加到链接的末尾。



如何结合这两个:

  a:visited {
color:Red
}
a:after {
content:[Old]
}


解决方案

这是一个隐私问题。由于浏览器可以检测元素样式,因此它可以知道您访问了哪些网站。现在JS可以在非常短的时间内检测非常大量的链接。因此,出于安全考虑,现代浏览器能够检测:访问类严重削减。



在mozilla的博客上阅读更多信息: http://blog.mozilla.com/security/2010/03/31/plugging- the-css-history-leak /



从Webkit changelog引用:



http://support.apple.com/kb/HT4196


$ b $影响:恶意制作的网站可能能够确定用户访问过的
网站



描述:A设计问题存在于WebKit的CSS
:visited伪类的处理中。恶意制作的网站可以能够确定用户访问了哪些网站。此更新根据链接是否被
访问,将网页的
能力限制为样式页面。


问题(有更多链接):




How can I style a anchor tag so that once the link is visited it will change to Red and append [Old] to the end of the link.

So how do I combine these two:

a:visited{
   color:Red
}
a:after{
   content:[Old]
}

解决方案

This is a privacy issue. As browser can detect element styles, it can therefore know what sites did you visit. An right now JS can detect it for a very large number of links in very short time. So for security reasons modern browser's ability to detect :visited class is severely cutted down.

Read more about it on mozilla's blog: http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/

Citation from Webkit changelog:

http://support.apple.com/kb/HT4196

Impact: A maliciously crafted website may be able to determine which sites a user has visited

Description: A design issue exists in WebKit's handling of the CSS :visited pseudo-class. A maliciously crafted website may be able to determine which sites a user has visited. This update limits the ability of web pages to style pages based on whether links are visited.

Similiar questions (have more links):

这篇关于CSS伪类组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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