text-decoration-line プロパティ
text-decoration-line プロパティは、テキストの下線、上線、取り消し線を指定する CSS プロパティです。
CSSでは、text-decoration プロパティはテキストへの装飾という扱いです。
text-decoration-line プロパティは複数の値を指定することができ、テキストの下と上に線を入れることもできます。
text-decoration-line: line-through;
text-decorationの例です。
マーカーのような線を加えるにはbackgroundプロパティにlinear-gradient()関数を使います。
ページ内 Index
構文(Syntax)
CSS
text-decoration-line: none | underline | overline | line-through | initial | inherit;
DOM ( JavaScript )
String = object.style.textDecorationLine;
object.style.textDecorationLine="none | underline | overline | line-through | initial | inherit";
値(Values)
Value | 摘要 |
---|---|
none | 初期値(default値) |
underline | 下線 |
overline | 上線 |
line-through | 中央を貫く線(取り消し線のような) |
initial | 初期値に戻す |
inherit | 親エレメントのプロパティを継承 |
備考(Remarks)
初期値(Default value) | none |
継承(Inherited) | No |
CSS Animation | No |
Example
text-decoration-lineの例です。
ここではline-through値で、テキストの中央に線が表示されます。
関連プロパティ
以下のような関連するプロパティがあります。
text-decoration-color | 装飾線の色 |
text-decoration-style | 装飾線の線種 |
text-decoration | 装飾線のプロパティtext-decoration-*を一括指定 |