このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

Document: linkColor プロパティ

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 model、またはgetComputedStyle().

Document.linkColor プロパティは、文書内のリンクの色を取得または設定します。

このプロパティは非推奨です。代替手段として、 CSS の color プロパティを HTML のアンカーリンク (<a>) または :link 擬似クラスで設定することができます。もう一つの代替手段に document.body.link がありますが、これは HTML 4.01 で非推奨になりました

引数

文字列で、色を単語 (例えば red) または 16 進値 (例えば #ff0000) で表します。

js
document.linkColor = "blue";

仕様書

HTML5

Document.linkColorDOM Level 2 HTML で非推奨になりました

ブラウザーの互換性

Mozilla Firefox におけるこのプロパティの既定値は、青 (16 進数で #0000ee) です。

関連情報