Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

document.vlinkColor

非推奨
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

概要

訪問済リンク色を取得 / 設定します。

構文

color = document.vlinkColor; //取得
document.vlinkColor = color; //設定

引数

  • color : リンク色を表す色名 ("green" 等) またはカラーコード ("#ff0000" 等) の文字列

注記

Mozilla Firefox ではこのプロパティの初期値は #551a8b となっています。

document.vlinkColorDOM Level 2 HTML では非推奨となっており、代替となる document.body.vLinkHTML 4.01 で非推奨となっています

CSS を用い、 <a> 要素及びそのダイナミック疑似クラス (:link:visited:hover:focus:active) の color プロパティを設定する事により、より細やかな設定が可能です。

動的に行う必要がある場合は、 CSSStyleSheetinsertRule メソッドなどを用いる事によりこれを実現する事が可能です。また、スタイルシートに予め特定の CSS クラスに対する記述を施しておき ( body.redLink a { color: red; } ) 、対象要素のクラス名を element.setAttribute メソッドなどを用いて切り替えるという方法もあります。この様な方法を用いれば、スタイル、マークアップ、スクリプトを分離し、それぞれをクリーンに保つ事ができます。

document.vlinkColor = "darkMagenta"; 

仕様

DOM Level 0。どの標準にも属しません。

関連情報

ドキュメントのタグと貢献者

タグ: 
 このページの貢献者: fscholz, jsx, ethertank
 最終更新者: jsx,