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 / background-image

CSS / Reference / background-image

background-image는 이미지를 배경으로 사용하게 하는 속성입니다. 기본값 : none 상속 : No 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / text-indent

CSS / Reference / text-indent

들여쓰기와 내어쓰기는 text-indent 속성으로 만듭니다. 값이 양수이면 들여쓰기, 값이 음수이면 내어쓰기가 됩니다. 내어쓰기를 할 때는 왼쪽에 여백을 적절히 줍니다.

CSS / Reference / text-decoration

CSS / Reference / text-decoration

text-decoration은 선으로 텍스트를 꾸밀 수 있게 해주는 속성입니다. 기본값 : none 상속 : No 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / font-weight

CSS / Reference / font-weight

font-weight 속성은 CSS에서 글꼴의 굵기를 지정하는 데 사용됩니다. 텍스트의 가독성을 높이거나 디자인의 강조점을 표현할 때 유용합니다. 기본값 : normal 상속 : Yes 애니메이션 : Yes 버전 : CSS Level 1

CSS / Reference / border-style

CSS / Reference / border-style

border-style은 테두리(border)의 모양을 정하는 속성으로, 다음 속성의 단축 속성입니다. border-top-style border-right-style border-bottom-style border-left-style

CSS / Reference / font-family

CSS / Reference / font-family

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

CSS / Reference / font-variant

CSS / Reference / font-variant

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

CSS / Reference / accent-color

CSS / Reference / accent-color

accent-color는 HTML의 폼 요소에 사용되는 강조 색상을 정하는 속성입니다. 기본적으로 브라우저는 사용자 인터페이스 요소에 특정한 시스템 색상을 사용하지만, accent-color를 사용하면 이러한 요소들의 강조 색상을 커스터마이즈할 수 있습니다.

CSS / Reference / font-style

CSS / Reference / font-style

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

CSS / Reference / word-wrap

CSS / Reference / word-wrap

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