CSS text-decoration 属性
- 前のページ text-align-last
- 次のページ text-decoration-color
定義と使用法
text-decoration 属性は、テキストに追加される装飾を指定します。
注記:装飾の色は "color" 属性で設定されます。
説明
この属性は、テキストに効果を設定するのを許可します、例えば、下線を付けるなど。後継子要素に装飾がなければ、祖先要素に設定された装飾が「拡張」されます。blink をサポートする必要はありません。
他にも参照してください:
CSS 教程:CSS テキスト
HTML DOM リファレンスマニュアル:textDecoration 属性
例
h1、h2、h3、h4 要素のテキスト装飾を設定します:
h1 {text-decoration:overline;} h2 {text-decoration:line-through;} h3 {text-decoration:underline;} h4 {text-decoration:blink;}
CSS 文法
text-decoration: text-decoration-line text-decoration-color text-decoration-style text-decoration-thickness|initial|inherit;
属性値
値 | 説明 |
---|---|
text-decoration-line | 使用するテキスト装飾のタイプ(下線、上線、破線など)を設定します。 |
text-decoration-color | テキスト装飾の色を設定します。 |
text-decoration-style | テキスト装飾のスタイル(実心、波線、点線、破線、双線など)を設定します。 |
text-decoration-thickness | 装飾線の太さを設定します。 |
initial | この属性をデフォルト値に設定します。initial を参照してください。 |
inherit | この属性は、親要素からこの属性を継承します。inherit を参照してください。 |
技術的詳細
デフォルト値: | none |
---|---|
継承性: | no |
バージョン: | CSS1 |
JavaScript 文法: | object |
さらに多くの例
- 装飾テキスト
- この例では、テキストに装飾を追加する方法を示します。
ブラウザのサポート
このテーブルの数字は、その属性を完全にサポートする最初のブラウザのバージョンを示しています。
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
- 前のページ text-align-last
- 次のページ text-decoration-color