The :any-link
CSS pseudo-class selector represents an element that acts as the source anchor of a hyperlink independent of whether it has been visited, that is, it matches every <a>
, <area>
, or <link>
element with an href
attribute. Thus, it matches all elements that match :link
or :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;
}
Syntax
:any-link
Examples
: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>
Result
Specifications
Specification | Status | Comment |
---|---|---|
Selectors Level 4 The definition of ':any-link' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.