For faster navigation, this Iframe is preloading the Wikiwand page for Help:链接颜色.

Help:链接颜色

在维基百科中,链接颜色和目标页面状态相对应。(Vector皮肤的)默认颜色有如下含义:

链接样式 类型 颜色 颜色
蓝色链接 指向当前存在的页面 #0645AD = rgb(6,69,173)  
深蓝色链接 指向已经访问过的存在页面 #0B0080 = rgb(11,0,128)  
红色链接 指向维基百科中未建立的页面 #DD3333 = rgb(221,51,51)  
浅红色链接 指向未连接但访问过的页面 #A55858 = rgb(165,88,88)  
绿色链接 在未建立的页面下,指向维基百科其它语言的页面 #007000 = rgb(0,128,0)  
浅绿色链接 未创建的页面指的是其他语言的维基百科访问页面 #408080 = rgb(64,128,128)  
棕色链接 指向维基百科中很短的条目,但只有用户在参数设置里启用“短页面链接”选项才有效 #772233 = rgb(119,34,51)  
淡蓝色链接 指向其它wiki
注意这个页面无论是否在目标wiki上存在,链接都显示为淡蓝色。比如对于中文维基上的条目喬治亞州,日语维基不存在这个名称相同的页面,他们的对应页面是ジョージア州外部链接也是用这种颜色
#3366BB = rgb(51,102,187)  
紫色链接 指向其它站点但访问过的链接 #663366 = rgb(102,51,102)  

登录用户可以通过更换皮肤或自定义CSS改变颜色。

自定义链接颜色[编辑]

让内部链接对所有人都显示为不同颜色

你可以这样将链接改为不同颜色:

  • [[维基百科|<span style="color:green">这个页面存在</span>]]
  • [[喂鸡百科|<span style="color:green">这个页面不存在</span>]]

这会显示为:

如果你想让页面自动检查是否存在,可以:

  • [[维基百科|((#ifexist: 维基百科|<span style="color:green">这个页面存在</span>|这个页面不存在))]]
  • [[喂鸡百科|((#ifexist: 喂鸡百科|<span style="color:green">这个页面存在</span>|这个页面不存在))]]

这会显示为:

仅改变自己看到的链接顏色

你可以通过编辑自己的CSS文件来自定义链接颜色。

标准的链接选择器有:

  • a:link—定义常规的未访问链接的样式
  • a:visited—定义已访问链接的样式
  • a:active—定义激活链接的样式;激活指的是点击过一次链接
  • a:hover—定义悬浮链接的样式;悬浮指当鼠标移动到链接上面

颜色由十六进制计数法表示:见网页颜色

/* standard link colors */
.mw-body a:link {color: #0000FF} /* 常规未访问链接 */
.mw-body a:link:visited {color: #7F007F} /* 已访问链接 */
.mw-body a:link:active {color: #FF0000} /* 激活链接 */
.mw-body a:link.new {color: #FF0000} /* 新链接 */
.mw-body a:link.interwiki {color: #3366BB} /* 跨wiki链接 */
.mw-body a:link.external {color: #3366BB} /* 外部链接 */
.mw-body a:link.stub {color: #772233} /* 悬浮链接 */

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

注意:

  • a:hover必定后于a:link和a:visited显示
  • a:active必定后于a:hover显示
  • 你需要在标准链接定以前加上“.mw-body”,否则网站默认定义会优先于你的定义。
重定向链接

将重定向链接改为绿色链接:

.mw-body a.mw-redirect {color:#308050}
.mw-body a.mw-redirect:visited {color:#3070A0}
外部链接
.mw-body a.external {color: #008000}

其他改变

你还可以改变文本的其它格式

文字修饰

这可以修改文本格式。比如添加下划线:

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

可选值有:

  • none
  • underline
  • overline
  • line-through
字体类型

这会改变链接字体:

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

参见[编辑]

{{bottomLinkPreText}} {{bottomLinkText}}
Help:链接颜色
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?