We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

总结

:link伪类选择器是用来选中元素当中的链接。它将会选中所有尚未访问的链接,包括那些已经给定了其他伪类选择器的链接(例如:hover选择器,:active选择器,:visited选择器)。为了可以正确地渲染链接元素的样式,:link伪类选择器应当放在其他伪类选择器的前面,并且遵循LVHA的先后顺序,即::link:visited:hover:active。:focus伪类选择器常伴随在:hover伪类选择器左右,需要根据你想要实现的效果确定它们的顺序。

例子

a:link {color: slategray;}
.external:link {background-color: lightblue;}

规格详细

Specification Status Comment
HTML Living Standard
:link
Living Standard  
Selectors Level 4
:link
Working Draft 无变化
Selectors Level 3
:link
Recommendation 无变化.
CSS Level 2 (Revision 1)
:link
Recommendation 提升严格性为仅限于a标签元素
CSS Level 1
:link
Recommendation 初次定义

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1 1.0 (1.7 or earlier) 3.0 3.5 1.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 1.5 1.0 (1.9.2) ? ? 3.2

See also

文档标签和贡献者

此页面的贡献者: lixinxin93, FuckingChestnut, w0wbin, gengsinan
最后编辑者: lixinxin93,