CSS / Reference / caption-side

개요

caption-side는 표(table)의 caption 위치를 정하는 속성입니다.

  • 기본값 : top
  • 상속 : Yes
  • 애니메이션 : No
  • 버전 : CSS Level 2

문법

caption-side: top | bottom | initial | inherit
  • top : 기본값으로, 표의 위에 캡션을 위치시킵니다.
  • bottom : 표의 아래에 캡션을 위치시킵니다.
  • initial : 기본값으로 설정합니다.
  • inherit : 부모 요소의 속성값을 상속받습니다.

예제

<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <title>CSS</title>
    <style>
      table { width: 100%; }
      table, td { border: 1px solid #444444; }
      .abc { caption-side: top; }
      .xyz { caption-side: bottom; }
    </style>
  </head>
  <body>
    <p>Captionside Top</p>
    <table>
      <caption class="abc">caption-side: top;</caption>
      <tr>
        <td>Lorem</td>
        <td>Ipsum</td>
        <td>Dolor</td>
      </tr>
      <tr>
        <td>Sit</td>
        <td>Amet</td>
        <td>Elit</td>
      </tr>
    </table>
    <p>Captionside Bottom</p>
    <table>
      <caption class="xyz">caption-side: bottom;</caption>
      <tr>
        <td>Lorem</td>
        <td>Ipsum</td>
        <td>Dolor</td>
      </tr>
      <tr>
        <td>Sit</td>
        <td>Amet</td>
        <td>Elit</td>
      </tr>
    </table>
  </body>
</html>

같은 카테고리의 다른 글
CSS / Reference / font-style

CSS / Reference / font-style

font-style은 글자 모양을 정하는 속성으로, 기울임 여부를 정합니다. 기본값 : normal 상속 : Yes 애니메이션 : No 버전 : 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 / text-align

CSS / Reference / text-align

text-align은 문단 정렬 방식을 정하는 속성입니다. 기본값 : 읽는 방향이 LTR(왼쪽에서 오른쪽)인 경우 left, RTL(오른쪽에서 왼쪽)인 경우 right 상속 : Yes 애니메이션 : No 버전 : CSS Level 1

CSS / Reference / border

CSS / Reference / border

border는 다음의 속성을 포함하는 단축 속성으로, 테두리를 만듭니다. border-width border-style border-color

CSS / Reference / list-style-type

CSS / Reference / list-style-type

목록은 ul 태그 또는 ol 태그로 만듭니다. 목록 앞에 붙는 도형이나 문자을 마커(Marker)라고 하는데, 어떤 형식 또는 어떤 모양의 마커를 사용할지는 list-style-type으로 정할 수 있습니다.

CSS / Reference / text-shadow

CSS / Reference / text-shadow

text-shadow는 글자에 그림자 효과를 주는 속성입니다. 기본값 : none 상속 : Yes 애니메이션 : Yes 버전 : CSS Level 3 박스에 그림자 효과를 주고 싶다면 box-shadow 속성을 사용합니다.

CSS / Reference / background-position

CSS / Reference / background-position

background-position은 배경 이미지의 위치를 정하는 속성입니다. 기본값 : 0% 0% 상속 : No 애니메이션 : Yes 버전 : CSS Level 1

CSS / Reference / line-height

CSS / Reference / line-height

line-height 속성은 텍스트 줄 간격(줄 높이)을 조절하는 데 사용됩니다. 텍스트의 가독성을 높이고, 디자인적으로 더 일관된 레이아웃을 만들기 위해 자주 사용됩니다. 기본값 : normal 상속 : Yes 애니메이션 : Yes 버전 : CSS Level 1

CSS / Reference / font-size

CSS / Reference / font-size

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

CSS / Reference / border-spacing

CSS / Reference / border-spacing

border-spacing은 표의 테두리와 셀의 테두리 사이의 간격을 정하는 속성입니다. 기본값 : 2px 상속 : Yes 애니메이션 : No 버전 : CSS Level 2 border-spacing은 border-collapse의 값이 separate일 때만 적용됩니다.