CSS / Reference / background-repeat

개요

background-repeat는 배경 이미지의 반복 여부와 반복 방향을 정하는 속성입니다.

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

문법

background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit
  • repeat : 가로 방향, 세로 방향으로 반복합니다.
  • repeat-x : 가로 방향으로 반복합니다.
  • repeat-y : 세로 방향으로 반복합니다.
  • no-repeat : 반복하지 않습니다.
  • initial : 기본값으로 설정합니다.
  • inherit : 부모 요소의 속성값을 상속받습니다.

예제

  • background-repeat의 값이 repeat이면, 가로 방향과 세로 방향으로 반복합니다.
<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <title>CSS</title>
    <style>
      div {
        width: 100%;
        height: 600px;
        border: 1px solid #bcbcbc;
      }
      .a {
        background-image: url( "images/bg-house.png" );
        background-repeat: repeat;
      }
    </style>
  </head>
  <body>
    <div class="a">
    </div>
  </body>
</html>

  • background-repeat의 값이 repeat-x이면, 가로 방향으로 반복합니다.
background-repeat: repeat-x;

  • background-repeat의 값이 repeat-y이면, 세로 방향으로 반복합니다.
background-repeat: repeat-y;

  • background-repeat의 값이 no-repeat이면, 반복하지 않습니다.
background-repeat: no-repeat;

같은 카테고리의 다른 글
CSS / Reference / background-position

CSS / Reference / background-position

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

CSS / Reference / accent-color

CSS / Reference / accent-color

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

CSS / Reference / calc()

CSS / Reference / calc()

calc()는 괄호 안의 식을 계산한 결과를 속성값으로 사용하게 해주는 함수입니다. 예를 들어 다음은 는 글자 크기를 20px로 설정합니다. font-size: calc( 10px + 10px );

CSS / Reference / border-spacing

CSS / Reference / border-spacing

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

CSS / Reference / font-style

CSS / Reference / font-style

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

CSS / Reference / clip

CSS / Reference / clip

clip 속성으로 요소의 특정 부분만 나오도록 할 수 있습니다. 기본값 : auto 상속 : No 애니메이션 : Yes 버전 : CSS Level 2

CSS / Reference / background-image

CSS / Reference / background-image

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

CSS / Reference / white-space

CSS / Reference / white-space

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

CSS / Reference / opacity

CSS / Reference / opacity

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

CSS / Reference / empty-cells

CSS / Reference / empty-cells

empty-cells은 표(table)에서 빈 셀의 테두리를 표시할지 말지는 정하는 속성입니다. 기본값 : show 상속 : Yes 애니메이션 : No 버전 : CSS Level 2