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

:any-link

:any-link

:any-link 伪类表示一个作为超链接源锚点的元素(无论它是否已被访问),也就是说,它匹配每一个<a><area>或带有href属性的<link>。因此,它匹配所有满足:link或的元素:visited的元素。

代码语言:javascript
复制
/* Select any elements that would be matched by :link or :visited */
/* currently supported with -moz- and -webkit- prefixes */
:-moz-any-link {
  color: green;
  font-weight: bold;
}

:-webkit-any-link {
  color: green;
  font-weight: bold;
}

语法

代码语言:javascript
复制
:any-link

实例

代码语言:javascript
复制
:any-link {
  color: green;
  font-weight: bold;
}

:-moz-any-link {
  color: green;
  font-weight: bold;
}

:-webkit-any-link {
  color: green;
  font-weight: bold;
}
代码语言:javascript
复制
<a href="https://mozilla.org">Different page</a>
<a href="#">Anchor</a>
<map name="primary">
  <area shape="circle" coords="50,50,25" href="another.html" /> 
  <area shape="default" nohref />
</map>

结果

规范

Specification

Status

Comment

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

Working Draft

Initial definition.

浏览器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

(Yes) -webkit-

No

(Yes) -moz- 50.0

No

(Yes) -webkit-

(Yes) -webkit-

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes) -webkit-

(Yes) -webkit-

No

(Yes) -moz- 50.0

No

(Yes) -webkit-

(Yes) -webkit-

扫码关注腾讯云开发者

领取腾讯云代金券