CSS参考手册
选择 | Selectors
:any-link
:any-link
:any-link
伪类表示一个作为超链接源锚点的元素(无论它是否已被访问),也就是说,它匹配每一个<a>
,<area>
或带有href
属性的<link>
。因此,它匹配所有满足:link
或的元素:visited
的元素。
/* 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;
}
语法
:any-link
实例
:any-link {
color: green;
font-weight: bold;
}
:-moz-any-link {
color: green;
font-weight: bold;
}
:-webkit-any-link {
color: green;
font-weight: bold;
}
<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- |
选择 | Selectors相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。