備忘録的プログラミングリファレンス

text-decoration-color プロパティ

 text-decoration-color プロパティは、テキストに下線、上線、取り消し線を設定できる text-decoration-line プロパティに色を指定する CSS プロパティです。

赤い下線(Exampleの参照
text-decoration-line: underline;
text-decoration-color: red;
表示例

text-decorationの例です。

 波状、点線、破線、二重線といった線種は text-decoration-styletext-decoration で指定します。

 text-decoration に関するはプロパティは下線などを設定できますが、テキストへの装飾という扱いになっています。

 マーカーのような線にするにはbackgroundプロパティlinear-gradient()関数を使います。

ページ内 Index

構文(Syntax)

CSS

text-decoration-color: color | initial | inherit;

DOM ( JavaScript )

値の取得
String = object.style.textDecorationColor;
値の設定
object.style.textDecorationColor="color | initial | inherit";

値(Values)

Value摘要
colorCSS Colorを参照のこと
initial初期値に戻す
inherit親エレメントのプロパティを継承

備考(Remarks)

初期値(Default value)
継承(Inherited)No
CSS AnimationYes

Example

 text-decoration-color の例です。赤い下線を表示します。

 text-decoration-color が機能するには、text-decoration-line による装飾線の設定が必要です。