此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

Document:vlinkColor 属性

Deprecated

Avoid using this feature in new projects. Document color attributes are superseded by CSS. This feature may be a candidate for removal from web standards or browsers.

Consider using the following features instead: background-colorColorCSS object modelgetComputedStyle().

Document.vlinkColor 属性用于获取或设置文档中用户已访问链接的颜色。

表示颜色的单词(例如 "red")或十六进制值(例如 "#ff0000")的字符串。

当设置为 null 值时,该 null 值会被转换为空字符串 (""),因此 document.vlinkColor = null 等同于 document.vlinkColor = ""

备注

  • 在 Mozilla Firefox 中,此属性的默认值为紫色(十六进制为 #551a8b)。
  • Document.vlinkColorHTML 规范中已被弃用。
  • 推荐的替代方法是通过 CSS :visited 伪类来获取/设置 HTML <a> 元素的颜色(例如 a:visited {color:red;})。

规范

规范
HTML
# dom-document-vlinkcolor

浏览器兼容性