テキストのアンダーラインの色を変更します:
p
{
text-decoration: underline;
-moz-text-decoration-color: red; /* Code for Firefox */
text-decoration-color: red;
}
Try it Yourself ❯
text-decoration-color プロパティは、text-decoration (underlines, overlines, linethroughs) の色を指定します。
注: text-decoration-color プロパティは、text-decoration を表示する要素にのみ効果があります。
デフォルト値: | currentColor |
---|---|
継承: | 継承する |
アニメーション可否: | 可。animatable を参照 Try it |
バージョン: | CSS3 |
JavaScript 構文: | object.style.textDecorationColor="red" Try it |
表中の数字は、完全にプロパティをサポートした最初のブラウザのバージョンです。
-moz- の後に続く数字 は、接頭辞付きで動作した最初のバージョンです。
プロパティ | |||||
---|---|---|---|---|---|
text-decoration-color | 未サポート | 未サポート | 6.0 -moz- | 未サポート | 未サポート |
text-decoration-color: color|initial|inherit;
値 | 説明 | Play it |
---|---|---|
color | text-decoration の色を指定します | Play it ❯ |
initial | プロパティにデフォルト値を設定します。initial を参照 | Play it ❯ |
inherit | このプロパティは親要素を継承します。inherit を参照 |
CSS チュートリアル: CSS Text
HTML DOM リファレンス:textDecorationColor プロパティ