This translation is incomplete. Please help translate this article from English.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

La pseudo-classe CSS :any-link representa un element que actua com a àncora font d'un hiperenllaç, independentment de si s'ha visitat. En altres paraules, coincideix amb cada element <a>, <area> o <link> que té un atribut href. D'aquesta manera, es correspont amb tots els elements que coincideixen amb :link o :visited.

/*  Selecciona qualsevol element que coincideixi amb :link o :visited */
:-any-link {
  color: green;
}

Sintaxi

:any-link

Exemple

HTML

<a href="https://example.com">External link</a><br>
<a href="#">Internal target link</a><br>
<a>Placeholder link (won't get styled)</a>

CSS

a:any-link {
  border: 1px solid blue;
  color: orange;
}

/* WebKit browsers */
a:-webkit-any-link {
  border: 1px solid blue;
  color: orange;
}

Resultat

Especificacions

Especificació Estat Comentari
Selectors Level 4
The definition of ':any-link' in that specification.
Working Draft Definició inicial

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge No support NoFirefox Full support 50
Full support 50
No support 1 — ?
Prefixed
Prefixed Requires the vendor prefix: -moz-
IE No support NoOpera Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Safari Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
WebView Android Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Chrome Android Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge Mobile No support NoFirefox Android Full support 50
Full support 50
No support 4 — ?
Prefixed
Prefixed Requires the vendor prefix: -moz-
Opera Android Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Safari iOS Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

Document Tags and Contributors

Contributors to this page: Legioinvicta
Last updated by: Legioinvicta,