---
title: text-decoration
slug: Web/CSS/text-decoration
tags:
  - CSS
  - CSS Property
  - CSS Text Decoration
  - Reference
  - 'recipe:css-shorthand-property'
  - text-decoration
  - text-decoration-color
  - text-decoration-line
  - text-decoration-style
translation_of: Web/CSS/text-decoration
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><strong><code>text-decoration</code></strong> は <a href="/ja/docs/Web/CSS">CSS</a> の <a href="/ja/docs/Web/CSS/Shorthand_properties">一括指定</a>プロパティで、テキストの装飾的な線の表示を設定します。</span>これは {{cssxref("text-decoration-line")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-style")}} およびさらに新しい {{cssxref("text-decoration-thickness")}} プロパティの一括指定です。</p>

<div>{{EmbedInteractiveExample("pages/css/text-decoration.html")}}</div>

<p>文字列の装飾は、子孫の文字列要素に適用されます。つまり、要素に文字列装飾が指定されれば、子要素では装飾を外すことができません。例えば、 <code>&lt;p&gt;This text has &lt;em&gt;some emphasized words&lt;/em&gt; in it.&lt;/p&gt;</code> というマークアップと、 <code>p { text-decoration: underline; }</code> のスタイル規則では、段落全体に下線が引かれます。 <code>em { text-decoration: none; }</code> のスタイル規則を適用しても変化せず、段落全体に下線が引かれたままになります。しかし、 <code>em { text-decoration: overline; }</code> の規則で "some emphasized words" に第二の装飾が施されます。</p>

<h2 id="Constituent_properties">構成要素のプロパティ</h2>

<p>このプロパティは以下の CSS プロパティの一括指定です。</p>

<ul>
	<li><a href="/ja/docs/Web/CSS/text-decoration-color"><code>text-decoration-color</code></a></li>
	<li><a href="/ja/docs/Web/CSS/text-decoration-line"><code>text-decoration-line</code></a></li>
	<li><a href="/ja/docs/Web/CSS/text-decoration-style"><code>text-decoration-style</code></a></li>
	<li><a href="/ja/docs/Web/CSS/text-decoration-thickness"><code>text-decoration-thickness</code></a></li>
</ul>

<h2 id="Syntax">構文</h2>

<p><code>text-decoration</code> プロパティは、個別指定の text-decoration プロパティを表す 1 つまたは複数の値を空白で区切って指定します。</p>

<h3 id="Values">値</h3>

<dl>
	<dt>{{cssxref("text-decoration-line")}}</dt>
	<dd>使用する装飾の種類を設定します。 <code>underline</code> や <code>line-through</code> などです。</dd>
	<dt>{{cssxref("text-decoration-color")}}</dt>
	<dd>装飾の色を設定します。</dd>
	<dt>{{cssxref("text-decoration-style")}}</dt>
	<dd>装飾に使用する線のスタイルを設定します。 <code>solid</code>, <code>wavy</code>, <code>dashed</code> などです。</dd>
	<dt>{{cssxref("text-decoration-thickness")}}</dt>
<dd>装飾に使われる線の太さを設定します。</dd>
</dl>

<h2 id="Formal_definition">公式定義</h2>

<p>{{CSSInfo}}</p>

<h2 id="Formal_syntax">形式文法</h2>

{{csssyntax}}

<h2 id="Examples">例</h2>

<h3 id="Demonstration_of_text-decoration_values">text-decoration の値のデモ</h3>

<pre class="brush: css">.under {
  text-decoration: underline red;
}

.over {
  text-decoration: wavy overline lime;
}

.line {
  text-decoration: line-through;
}

.plain {
  text-decoration: none;
}

.underover {
  text-decoration: dashed underline overline;
}

.thick {
  text-decoration: solid underline purple 4px;
}

.blink {
  text-decoration: blink;
}
</pre>

<pre class="brush: html">&lt;p class="under"&gt;This text has a line underneath it.&lt;/p&gt;
&lt;p class="over"&gt;This text has a line over it.&lt;/p&gt;
&lt;p class="line"&gt;This text has a line going through it.&lt;/p&gt;
&lt;p&gt;This &lt;a class="plain" href="#"&gt;link will not be underlined&lt;/a&gt;,
    as links generally are by default. Be careful when removing
    the text decoration on anchors since users often depend on
    the underline to denote hyperlinks.&lt;/p&gt;
&lt;p class="underover"&gt;This text has lines above &lt;em&gt;and&lt;/em&gt; below it.&lt;/p&gt;
&lt;p class="thick"&gt;This text has a really thick purple underline in supporting browsers.&lt;/p&gt;
&lt;p class="blink"&gt;This text might blink for you,
    depending on the browser you use.&lt;/p&gt;
</pre>

<p>{{EmbedLiveSample('Examples','auto','320')}}</p>

<h2 id="Specifications">仕様書</h2>

<table class="standard-table">
	<thead>
		<tr>
			<th scope="col">仕様書</th>
			<th scope="col">状態</th>
			<th scope="col">備考</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>{{SpecName('CSS4 Text Decoration')}}</td>
			<td>{{Spec2('CSS4 Text Decoration')}}</td>
			<td>{{cssxref("text-decoration-thickness")}} を追加。なお、これはまだ公式には一括指定の一部ではありません。これはまだ未定義です。</td>
		</tr>
		<tr>
			<td>{{SpecName('CSS3 Text Decoration', '#text-decoration-property', 'text-decoration')}}</td>
			<td>{{Spec2('CSS3 Text Decoration')}}</td>
			<td>一括指定プロパティへ変更。 {{cssxref('text-decoration-style')}} の値への対応を追加。</td>
		</tr>
		<tr>
			<td>{{SpecName('CSS2.1', 'text.html#lining-striking-props', 'text-decoration')}}</td>
			<td>{{Spec2('CSS2.1')}}</td>
			<td>実質的な変更なし。</td>
		</tr>
		<tr>
			<td>{{SpecName('CSS1', '#text-decoration', 'text-decoration')}}</td>
			<td>{{Spec2('CSS1')}}</td>
			<td>初回定義</td>
		</tr>
	</tbody>
</table>

<h2 id="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat("css.properties.text-decoration")}}</p>

<h2 id="See_also">関連情報</h2>

<ul>
	<li>text-decoration の個別指定プロパティは、 {{cssxref("text-decoration-line")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-style")}} です。</li>
	<li>{{cssxref("list-style")}} 属性は HTML の {{HTMLElement("ol")}} および {{HTMLElement("ul")}} のリストの表示方法を制御します。</li>
</ul>