text-decoration-color プロパティ
text-decoration-color プロパティは、テキストに下線、上線、取り消し線を設定できる text-decoration-line プロパティに色を指定する CSS プロパティです。
波状、点線、破線、二重線といった線種は text-decoration-style や text-decoration で指定します。
text-decoration に関するはプロパティは下線などを設定できますが、テキストへの装飾という扱いになっています。
マーカーのような線にするにはbackgroundプロパティにlinear-gradient()関数を使います。
ページ内 Index
構文(Syntax)
CSS
DOM ( JavaScript )
値(Values)
Value | 摘要 |
---|---|
color | CSS Colorを参照のこと |
initial | 初期値に戻す |
inherit | 親エレメントのプロパティを継承 |
備考(Remarks)
初期値(Default value) | |
継承(Inherited) | No |
CSS Animation | Yes |
Example
text-decoration-color の例です。赤い下線を表示します。
text-decoration-color が機能するには、text-decoration-line による装飾線の設定が必要です。
関連する CSS プロパティ
以下のような関連するプロパティがあります。
text-decoration-color | 装飾線の色 |
text-decoration-line | テキストの下線、上線、取り消し線を指定 |
text-decoration-style | 装飾線の線種 |
text-decoration | 装飾線のプロパティtext-decoration-*を一括指定 |
マーカーのような線を加えるにはbackgroundプロパティにlinear-gradient()関数を使います。