CSS / Reference / text-decoration

개요

text-decoration은 선으로 텍스트를 꾸밀 수 있게 해주는 속성입니다.

  • 기본값 : none
  • 상속 : No
  • 애니메이션 : No
  • 버전 : CSS Level 1

문법

text-decoration: none | line-through | overline | underline | initial | inherit
  • none : 선을 만들지 않습니다.
  • line-through : 글자 중간에 선을 만듭니다.
  • overline : 글자 위에 선을 만듭니다.
  • underline : 글자 아래에 선을 만듭니다.
  • initial : 기본값으로 설정합니다.
  • inherit : 부모 요소의 속성값을 상속받습니다.

속성값을 여러개 사용하여 여러 선을 만들 수 있습니다. 예를 들어 다음은 글자 위와 아래에 선을 만듭니다.

text-decoration: overline underline;

예제

<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <title>CSS Reference</title>
    <style>
      .a {text-decoration: none;}
      .b {text-decoration: line-through;}
      .c {text-decoration: overline;}
      .d {text-decoration: underline;}
      .e {text-decoration: overline underline;}
      .f {text-decoration: overline underline line-through;}
    </style>
  </head>
  <body>
    <p class="a">text-decoration: none;</p>
    <p class="b">text-decoration: line-through;</p>
    <p class="c">text-decoration: overline;</p>
    <p class="d">text-decoration: underline;</p>
    <p class="e">text-decoration: overline underline;</p>
    <p class="f">text-decoration: overline underline line-through;</p>
  </body>
</html>

같은 카테고리의 다른 글
CSS / Reference / content

CSS / Reference / content

content는 선택한 요소의 앞이나 뒤에 텍스트, 이미지 등을 추가하는 속성입니다. 기본값 : normal 상속 : No 애니메이션 : No 버전 : CSS Level 2

CSS / Reference / word-wrap

CSS / Reference / word-wrap

word-wrap은 띄어쓰기가 없는 긴 단어를 어떻게 처리할지 정하는 속성입니다. 기본값 : normal 상속 : Yes 애니메이션 : No 버전 : CSS Level 3

CSS / Reference / opacity

CSS / Reference / opacity

opacity로 요소의 투명도를 정할 수 있습니다. 기본값 : 1 상속 : No 애니메이션 : Yes 버전 : CSS Level 3

CSS / Reference / font-family

CSS / Reference / font-family

font-family는 글꼴을 설정하는 속성입니다. 기본값 : 웹브라우저의 기본 글꼴 상속 : Yes 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / white-space

CSS / Reference / white-space

white-space는 스페이스와 탭, 줄바꿈, 자동줄바꿈을 어떻게 처리할지 정하는 속성입니다. 기본값 : normal 상속 : Yes 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / font-variant

CSS / Reference / font-variant

font-variant는 소문자를 작은 대문자, 즉 소문자 크기의 대문자로 바꾸는 속성입니다. 따라서 한글에서는 의미 없는 속성입니다. 기본값 : normal 상속 : Yes 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / font-style

CSS / Reference / font-style

font-style은 글자 모양을 정하는 속성으로, 기울임 여부를 정합니다. 기본값 : normal 상속 : Yes 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / font-size

CSS / Reference / font-size

font-size는 글자 크기를 정하는 속성입니다. 기본값 : medium 상속 : Yes 애니메이션 : Yes 버전 : CSS Level 1

CSS / Reference / color

CSS / Reference / color

color로 텍스트의 색을 정합니다. 상속 : Yes 애니메이션 : Yes 버전 : CSS Level 1

CSS / Reference / box-sizing

CSS / Reference / box-sizing

box-sizing은 박스의 크기를 어떤 것을 기준으로 계산할지를 정하는 속성입니다. 기본값 : content-box 상속 : No 애니메이션 : No 버전 : CSS Level 3