Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. [CSS Selector] E:link

[CSS Selector] E:link

Using selector:link, you can apply styles to elements that have a link destination. Since it applies to elements with a link target, it is mainly used with the a element. This is commonly called a "pseudo-class" (the :link pseudo-class).

Be aware that this rule can be overridden by other pseudo-classes, so the order of declarations matters. Writing them in the order ':link', ':visited', ':hover', ':active' (the "LVHA" order) prevents conflicts.

Sample Code

a:link { color: red;} /* If you want to differentiate unvisited and visited link styles, always write ':link' before ':visited'. */
a:visited { color: orange;}

In practice, you can think of this as applying to any a element that has an 'href' attribute.

Browser Display Result

※ To test the sample below, please clear your browser's browsing history first.

a:link { color: red;} /* Makes the text of a elements with a link destination red. */

<p><a target="_blank" href="https://www.google.co.jp/">Goes to Google's page.</a></p>
<p><a>This is an a element with no 'href' attribute, so it does not turn red.</a></p>

Browser Compatibility

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
1+
Edge Edge
12+
Supported in all versions
IE IE
11
10
9
8
7
6
Opera Opera
3.5+
2 and earlier ×
iOS Safari iOS Safari
3.2+
2 and earlier ×
Android Android Browser
1.5+
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version data is based on MDN.

If you find any errors or copyright issues, please .