CSS辞書

text-decoration

テキスト・フォント

テキストの装飾(下線、上線、取り消し線など)を指定するプロパティです。underline、overline、line-through、noneなどの値があり、リンクやテキストの強調に使用されます。色やスタイルも個別に指定可能です。

構文

Syntax
text-decoration: <text-decoration-line> <text-decoration-style> <text-decoration-color>

Tailwindでは

underlinetext-decoration-line: underline
line-throughtext-decoration-line: line-through
no-underlinetext-decoration-line: none

線の色・太さ・スタイルは decoration-{color} / decoration-2 / decoration-wavy。

コード例

1

text-decoration: underline;
実行結果

下線付きテキスト

下線を追加

2

text-decoration: line-through red;
実行結果

赤い取り消し線

赤い取り消し線

3

text-decoration: underline wavy blue;
実行結果

青い波線の下線

青い波線の下線

💡 TIPS

リンクのスタイリングでよく使用。noneでデフォルトの下線を削除。

🤖 AIがよく間違えるポイント

AIは下線のカスタマイズにborder-bottomを使いがちですが、現在はtext-decoration-color / -thickness / text-underline-offsetで下線自体を細かく制御できます(複数行でも正しく機能するのが利点)。リンクの下線を消すだけの提案(アクセシビリティ低下)にも注意が必要です。

💬 AIへの頼み方

リンクの下線を消さずに、色を薄く・少し下にオフセットして上品にして。border-bottomではなくtext-decoration系で

そのままAIチャットに貼り付けて使える依頼文の例です。ページ上部の「AI用にコピー」でこのページ全体をコンテキストとして渡せます。

ブラウザサポート

Baseline 広く利用可能
Chrome
1+
Firefox
1+
Safari
1+
Edge
12+