首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

:link

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

代码语言:javascript
复制
/* Selects any link that has not been visited yet */
a:link {
  color: red;
}

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

语法

代码语言:javascript
复制
:link

实例

代码语言:javascript
复制
a:link { color: cyan; }
.external:link { color: green; }

规范

Specification

Status

Comment

HTML Living StandardThe definition of ':link' in that specification.

Living Standard

?

Selectors Level 4The definition of ':link' in that specification.

Working Draft

No change.

Selectors Level 3The definition of ':link' in that specification.

Recommendation

No change.

CSS Level 2 (Revision 1)The definition of ':link' in that specification.

Recommendation

Lift the restriction to only apply it for <a> element.

CSS Level 1The definition of ':link' in that specification.

Recommendation

Initial definition.

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

1

(Yes)

1.0 (1.7 or earlier)

3.0

3.5

1.0

Feature

Android

Edge

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

1.5

(Yes)

1.0 (1.9.2)

?

?

3.2

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com