Document:alinkColor 属性

已弃用: 不再推荐使用该特性。虽然一些浏览器仍然支持它,但也许已从相关的 web 标准中移除,也许正准备移除或出于兼容性而保留。请尽量不要使用该特性,并更新现有的代码;参见本页面底部的兼容性表格以指导你作出决定。请注意,该特性随时可能无法正常工作。

返回或设置文档正文中活动链接的颜色。在 mousedownmouseup 事件之间,链接处于活动状态。

包含颜色名称(例如 bluedarkblue 等)或颜色十六进制值(例如 #0000FF)的字符串。

备注

Mozilla Firefox 中该属性的默认值为红色(十六进制 #ee0000)。

DOM 第 2 版 HTMLdocument.alinkColor 已弃用。一种替代方法是 CSS 选择器 :active

另一种替代方法是 document.body.aLink,不过这种方法已在 HTML 4.01 中弃用,转而使用 CSS 替代方法。

Firefox 同时支持 alinkColor/:active:focus

规范

Specification
HTML
# dom-document-alinkcolor

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
alinkColor
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Deprecated. Not for use in new websites.
Has more compatibility info.