在线文档教程
CSS

:link

:link

:linkCSS 伪类代表尚未访问过的链接(例如锚)。

/* Selects any link that has not been visited yet */ a:link { color: red; }

:link伪类定义的样式会被任何后续的与链接相关的,具有至少相等特异性的伪类(:active:hover:visited)所覆盖。要正确地设置链接的样式,请将:link规则放在所有其他与LVHA顺序定义的链接相关的规则之前::link- :visited- :hover- :active

语法

:link

实例

a:link { color: cyan; } .external:link { color: green; }

规范

SpecificationStatusComment
HTML Living StandardThe definition of ':link' in that specification.Living Standard
Selectors Level 4The definition of ':link' in that specification.Working DraftNo change.
Selectors Level 3The definition of ':link' in that specification.RecommendationNo change.
CSS Level 2 (Revision 1)The definition of ':link' in that specification.RecommendationLift the restriction to only apply it for <a> element.
CSS Level 1The definition of ':link' in that specification.RecommendationInitial definition.

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1(Yes)1.0 (1.7 or earlier)3.03.51.0

FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support1.5(Yes)1.0 (1.9.2)??3.2