--- title: text-decoration slug: Web/CSS/text-decoration tags: - CSS - CSS Property - CSS Text Decoration - Reference translation_of: Web/CSS/text-decoration ---
text-decoration CSS 단축 속성은 글씨의 장식(선) 색을 지정합니다. {{cssxref("text-decoration-line")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-style")}}, {{cssxref("text-decoration-thickness")}}속성 값을 설정합니다.
글씨 장식은 모든 하위 텍스트 요소에 적용됩니다. 따라서 자식 요소는 부모가 적용한 장식을 제거할 수 없습니다. 예를 들어 <p>이 문단에 <em>강조 표시</em>가 있어요.</p> 마크업에 p { text-decoration: underline; } 스타일을 적용하면 전체 문단에 밑줄이 쳐집니다. em { text-decoration: none; }을 추가하더라도 아무 변화도 일어나지 않습니다. 다만 em { text-decoration: overline; } 스타일은 "강조 표시"가 윗줄과 밑줄 모두 갖게 합니다.
text-decoration 속성은 한 개 이상의 공백으로 구분한 값으로 지정할 수 있습니다. 각각의 값은 본디 속성에서 사용하는 값입니다.
underline, line-through 등 장식의 종류.solid, wavy, dashed 등 장식의 스타일..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;
}
<p class="under">밑줄을 가진 글씨입니다.</p>
<p class="over">윗줄을 가진 글씨입니다.</p>
<p class="line">취소선을 가진 글씨입니다.</p>
<p>여기 링크는 기본값과 다르게 <a class="plain" href="#">밑줄이 없습니다</a>.
사용자는 보통 하이퍼링크를 구분할 때 밑줄 여부로 판단하므로
지우기 전에 조심해야 합니다.</p>
<p class="underover">밑줄과 윗줄 모두 가진 글씨입니다.</p>
<p class="thick">이 글씨는 아주 두꺼운 보라색 밑줄을 표시합니다. (브라우저가 지원하는 경우)</p>
<p class="blink">이 글씨는 브라우저에 따라서 깜빡일 수 있어요.</p>
{{EmbedLiveSample('Examples','auto','320')}}
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('CSS4 Text Decoration')}} | {{Spec2('CSS4 Text Decoration')}} | Adds {{cssxref("text-decoration-thickness")}}; note that this isn't yet officially part of the shorthand — this is as yet unspecified. |
| {{SpecName('CSS3 Text Decoration', '#text-decoration-property', 'text-decoration')}} | {{Spec2('CSS3 Text Decoration')}} | Transformed into a shorthand property. Added support for the value of {{cssxref('text-decoration-style')}}. |
| {{SpecName('CSS2.1', 'text.html#lining-striking-props', 'text-decoration')}} | {{Spec2('CSS2.1')}} | No significant changes. |
| {{SpecName('CSS1', '#text-decoration', 'text-decoration')}} | {{Spec2('CSS1')}} | Initial definition. |
{{cssinfo}}
{{Compat("css.properties.text-decoration")}}