CSS - :any-link

The :any-link CSS pseudo-class 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> elements with an href attribute. So, it matches all elements that match :link or :visited.

Example

 

CSS
:any-link {
  color: green;
  font-weight: bold;
}
HTML
<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>

Syntax  

CSS
:any-link( <var>style properties</var> ) <a href="css/value_definition_syntax#curly_braces_(.7b_.7d)" title="Curly braces">{</a> <var>style properties</var> <a href="css/value_definition_syntax#curly_braces_(.7b_.7d)" title="Curly braces">}</a>

Description  

The :any-link CSS pseudo-class 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> elements with an href attribute. So, it matches all elements that match :link or :visited.

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? (Yes)-moz
50.0 (50.0)
? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes)-moz
50.0 (50.0)
? ? ?

Specifications  

Specification Status Comment
Selectors Level 4
The definition of ':any-link' in that specification.
Working Draft Initial definition

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/:any-link

CSS CSS Pseudo-class Experimental Layout NeedsBrowserCompatibility NeedsLiveSample NeedsMobileBrowserCompatibility Reference Web