首先a标签这几个伪类是有顺序的,a:hover 必须被置于 a:link 和 a:visited 之后,才是有效的,a:active 必须被置于 a:hover 之后,才是有效的
a:link{color:yellow;} /* 未访问的链接 */
a:visited {color:black;} /* 已访问的链接 */
a:hover{color:red;} /* 鼠标划过链接 */
a:active{color:green;} /* 已选中的链接 */
四个状态 同时存在,是有先后顺序的: a:link→a:visited→a:hover→a:active
除a:visited外其他超链接伪类任意属性都能设置,但是a:visited只能设置字体颜色属性(color)
为什么只能设置字体颜色?
经多次查找,如下:
WebKit is prone to an information-disclosure vulnerability. This issue occurs when Cascading Style Sheets (CSS) use the ':visited' pseudo-class. Attackers may determine which sites a user has visited.
NOTE: This issue was previously covered in BID 40620
(Apple Safari Prior to 5.0 and 4.1 Multiple Security Vulnerabilities) buthas been given its own record to better document it.
Both the next release versions of Gecko (tentatively na