定義と使い方
text-decoration-style プロパティは、テキストに text-decoration-line で指定された線装飾で引かれる線のスタイルを設定します。
このプロパティは、solid、dashed、dotted、double、wavy などのスタイルをサポートしています。
基本例
テキストの線装飾で引かれる線のスタイルを設定します。
形式構文
selector {
text-decoration-style: solid | double | dotted | dashed | wavy
}
値
text-decoration-style プロパティは、要素に指定されたテキスト装飾線のスタイルを指定します。以下の値は、これらのスタイルがどのように描画されるかを意味します。
solid |
一般的な実線のスタイルです。 |
|---|---|
double |
二重線のスタイルです。 |
dotted |
点線のスタイルです。 |
dashed |
破線のスタイルです。 |
wavy |
波線(ウェーブ)のスタイルです。 |
構文
/* キーワード値 */
text-decoration-style: solid;
text-decoration-style: double;
text-decoration-style: dotted;
text-decoration-style: dashed;
text-decoration-style: wavy;
/* グローバル値 */
text-decoration-style: inherit;
text-decoration-style: initial;
text-decoration-style: revert;
text-decoration-style: revert-layer;
text-decoration-style: unset;
形式定義
| 初期値 | solid |
|---|---|
| 適用要素 | すべての要素 |
| 継承 | いいえ |
| アニメーション | いいえ |
活用例
<p>テキストデコレーションスタイルの値が wavy です。</p>
p {
text-decoration: underline;
text-decoration-color: red;
text-decoration-style: wavy;
}
テキストデコレーションスタイルの値が wavy です。
ブラウザ互換性
| プロパティ |
デスクトップ Chrome
|
デスクトップ Edge
|
デスクトップ Firefox
|
Safari
|
|---|---|---|---|---|
text-decoration-style
|
57 | 79 | 36 | 12.1 |
仕様書
| 仕様書 | |
|---|---|
text-decoration-style
|
CSS Text Decoration Module Level 4 #text-decoration-style-property |