text-decoration
文字の装飾
text-decoration: 値;
文字の装飾(下線、上線、取り消し線、点滅)を指定するプロパティです。
text-decoration: underline;
プロパティ名 | 値 | 説明 |
---|---|---|
text-decoration | none | 装飾なし (初期値) |
underline | テキストに下線を引く | |
overline | テキストに上線を引く | |
line-through | テキストに取り消し線を引く | |
blink | テキストを点滅させる |
- 「blink」の指定は、IE、Safari、Chromeでは対応していません。
- 装飾線の色は、colorプロパティで指定された色になります。
値の指定例
このプロパティでは、複数の値を同時に指定することができます。次のように、半角スペースで区切って記述します。
text-decoration: underline overline;
.example1 {
color: red;
text-decoration: line-through;
}
.example2 {
text-decoration: underline overline;
}
a {
text-decoration: none;
}