Style textDecorationColorプロパティ

Style 对象参考手册Style オブジェクト

例

下線テキストの下線の色を変更する:

document.getElementById("myP").style.textDecorationColor="red";

試してみる »

定義と使い方

textDecorationColor プロパティは、テキスト装飾(下線 underline、上線 overline、取り消し線 line-through)の色を指定します。

注意:表示可能な text-decoration を持つ要素でのみ、textDecorationColor プロパティが有効になります。


ブラウザサポート

Internet Explorer Firefox Opera Google Chrome Safari

ほぼすべての主要ブラウザは textDecorationColor プロパティをサポートしていません。

Firefox は、このプロパティの代わりに MozTextDecorationColor プロパティをサポートしています。


構文

textDecorationColor プロパティを返す:

object.style.textDecorationColor

textDecorationColor プロパティを設定する:

object.style.textDecorationColor="color|initial|inherit"

プロパティ値

值 説明
color テキスト装飾の色を指定します。
initial このプロパティをデフォルト値に設定します。参照:initial。
inherit 親要素からこのプロパティを継承します。参照:inherit。

技術詳細

デフォルト値: currentColor
戻り値: 要素の text-decoration-color プロパティを表す文字列。
CSS バージョン CSS3


関連記事

CSS リファレンス:text-decoration-color プロパティ


Style 对象参考手册Style オブジェクト

その他の拡張