Help:Link color

From Vietnam Veterans for Factual History
Jump to: navigation, search

Lua error: Internal error: The interpreter exited with status 127. Lua error: Internal error: The interpreter exited with status 127.

Warning Warning: Links should clearly be identifiable as links to readers.
Refrain from implementing colored links that may impede user ability to distinguish links from regular text, or color links for purely aesthetic reasons. See the guides to editing articles for accessibility at contrast and navbox colors.

In Wikipedia, the color of a link shows the status of the corresponding target page. The default colors (in the Vector skin) have the following meanings: Lua error: Internal error: The interpreter exited with status 127.

Link style Type Color Color
blue link link to a page that currently exists #0645AD = rgb(6,69,173)     
dark blue link link to a page that you have already visited #0B0080 = rgb(11,0,128)     
red link link to a page that does not currently exist within Wikipedia #CC2200 = rgb(204,34,0)     
light brown link link to a page that does not exist, but you have visited #A55858 = rgb(165,88,88)     
brown link link to a very short article within Wikipedia, but only if the user has set a preference option to format "stub" links in this way #772233 = rgb(119,34,51)     
light blue link Lua error: Internal error: The interpreter exited with status to a page at another wiki, usually another Wikimedia project
Note that the light blue color is used whether or not the page actually exists at the target wiki. For example, there is an article about George Washington Carver here on the English Wikipedia, while there is no article of the same name on the Japanese Wikipedia; but they do have an article about the same man under a different title. The same color is used for external links, as well.
#3366BB = rgb(51,102,187)     
purple link link to a page at another site that has been visited #663366 = rgb(102,51,102)     

Note that the colors in the boxes may appear darker than text of the same color; also, larger or bold text will tend to look darker. Furthermore, the actual color seen by a user will vary slightly according to their operating system, desktop settings, and browser, as well as their monitor and (for low-end LCDs) viewing angle. Logged-in users can also change the colors they see by selecting a different skin or using custom CSS.

Custom link colors

Styling Individual links on a page

You can set the color of an individual link or set of links on page (rather than a global change to the style of all links) as follows. Setting styles in this way will apply to everybody, not just you.

Internal links

You can turn links a different color like so:

*[[example|<span style="color:green;">This page exists.</span>]]
*[[exampl|<span style="color:green;">This page does not exist.</span>]]
Renders as

Or, if you desire existence checking you can try:

*[[example|{{#ifexist: example|<span  style="color:green;">This page exists.</span>|This page does not exist.}}]]
*[[exampl|{{#ifexist: exampl|<span  style="color:green;">This page exists.</span>|This page does not exist.}}]]
Renders as

External links

A similar styled span can be added within an external link:

*[ <span style="color:green;">Example external link</span>]
Renders as

Styling all links just for you

You can also customize link colors by editing the CSS at your skin subpage. This is a change which will apply to all links throughout the site, but will only be visible to you

The standard link selectors are:

  • a:link — defines the style for normal unvisited links
  • a:visited — defines the style for visited links
  • a:active — defines the style for active links; links become active once you click on them
  • a:hover — defines the style for hovered links; links hover when the mouse moves over it

Colors are defined by hexadecimal characters: see web colors.

/* standard link colors */
.mw-body-content a:link { color: #0000FF; } /* normal unvisited links */
.mw-body-content a:link:visited { color: #0B0080; } /* visited links */
.mw-body-content a:link:active { color: #FF0000; } /* active links */
.mw-body-content { color: #FF0000; } /* new links */
.mw-body-content a:link.interwiki { color: #3366BB; } /* interwiki links */
.mw-body-content a:link.external { color: #3366BB; } /* external links */
.mw-body-content a:link.stub { color: #772233; } /* hovered links */

.mw-body-content a:link {color: #FF0000}
.mw-body-content a:visited {color: #00FF00}
.mw-body-content a:hover {color: #FF00FF}
.mw-body-content a:active {color: #0000FF}


  • a:hover must come after a:link and a:visited
  • a:active must come after a:hover
  • you need to have ".mw-body-content" in front of the standard link definition, because otherwise the default definition on this website will still take precedence over what you have defined.
Redirect links

Show redirects as green links:

.mw-body-content {color:#308050}
.mw-body-content {color:#3070A0}
External links
.mw-body-content a.external {color: #008000}
.mw-body-content a.external:visited {color: #008000}

Other changes

You can also format the text in other ways.


This allows formatting such as underlines. For example:

.mw-body-content a:link {color: #000000; text-decoration: underline; }

Possible values are:

  • none
  • underline
  • overline
  • line-through

This will change the link font:

.mw-body-content a:link {font-family: monospace}


User:Anomie/linkclassifier is a popular script that customizes colors to indicate links such as pages to be deleted, nonfree-media, redirects, protected pages and more.