The :link
CSS pseudo-class represents links (such as an anchor) that have not yet been visited.
/* Selects any link that has not been visited yet */ a:link { color: red; }
Styles defined by the :link
pseudo-class will be overridden by any subsequent link-related pseudo-class (:active
, :hover
, or :visited
) that has at least equal specificity. To style links appropriately, put the :link
rule before all other link-related rules, as defined by the LVHA-order: :link
— :visited
— :hover
— :active
.
Syntax
:link
Examples
a:link { color: cyan; } .external:link { color: green; }
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of ':link' in that specification. |
Living Standard | |
Selectors Level 4 The definition of ':link' in that specification. |
Working Draft | No change. |
Selectors Level 3 The definition of ':link' in that specification. |
Recommendation | No change. |
CSS Level 2 (Revision 1) The definition of ':link' in that specification. |
Recommendation | Lift the restriction to only apply it for <a> element. |
CSS Level 1 The definition of ':link' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1 | (Yes) | 1.0 (1.7 or earlier) | 3.0 | 3.5 | 1.0 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 1.5 | (Yes) | 1.0 (1.9.2) | ? | ? | 3.2 |
See also
Document Tags and Contributors
Tags:
Contributors to this page:
mfluehr,
chrisdavidmills,
magic96,
PolskiSwir345,
erikadoyle,
Sebastianz,
cvrebert,
bradleyflood,
potterbm,
tregagnon,
Vento,
kscarfone,
Deraillor,
teoli,
ethertank,
Sheppy,
chevalric,
Jürgen Jeka,
BijuGC
Last updated by:
mfluehr,