CSS 텍스트 장식 속성
예시
<h1>, <h2> 및 <h3> 요소에 대해 다른 텍스트 장식을 설정합니다.
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline
overline;
}
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
이 text-decoration
속성은 텍스트에 추가되는 장식을 지정하며 다음에 대한 약식 속성입니다.
- 텍스트 장식 라인(필수)
- 텍스트 장식 색상
- 텍스트 장식 스타일
기본값: | 없음 현재색상 솔리드 |
---|---|
상속: | 아니요 |
애니메이션 가능: | 아니요, 개별 속성을 참조하십시오 . 애니메이션 가능 에 대해 읽기 |
버전: | CSS1, CSS3에서 갱신 |
자바스크립트 구문: | 개체 .style.textDecoration="밑줄" |
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
text-decoration | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
CSS 구문
text-decoration: text-decoration-line text-decoration-color
text-decoration-style|initial|inherit;
속성 값
Value | Description |
---|---|
text-decoration-line | Sets the kind of text decoration to use (like underline, overline, line-through) |
text-decoration-color | Sets the color of the text decoration |
text-decoration-style | Sets the style of the text decoration (like solid, wavy, dotted, dashed, double) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
더 많은 예
예시
더 많은 텍스트 장식 추가:
h1 {
text-decoration: underline overline dotted red;
}
h2 {
text-decoration: underline overline wavy
blue;
}
관련 페이지
CSS 튜토리얼: CSS 텍스트
HTML DOM 참조: textDecoration 속성