:해당 요소의 배경으로 이미지 또는 색상을 정의
: 요소에 배경 이미지 지정
body {
background-image: url(" ");
background-color: #cccccc;
}
: 배경 이미지 반복 지정 (수직, 수평 또는 수직과 수평 모두의 반복 지정 가능)
background-repeat: repeat-x;
: x축으로만 배경 이미지 반복background-repeat: repeat-y;
: y축으로만 배경 이미지 반복background-repeat: no-repeat;
: 반복출력❌:배경 이미지의 사이즈 지정, 배경 이미지의 고유 비율을 유지하기 때문에 설정에 따라 이미지 일부가 보이지 않을 수 있음
: 배경 이미지 쿠가거 지정된 px값 그대로 지정
background-size: width height;
: 배경 이미지 크기가 지정된 %값에 비례하여 설정 -> 크기에 따라 변경되어 찌그러지는 현상 생김
background-size: width% height%;
: 배경 이미지의 크기 비율을 유지한 상태에서 부모요소의 width, height 중 큰값에 배경이미지를 맞춰서 이미지의 일부가 보이지 않을 수 있음
background-size: cover;
background-size: containd;
background-attachment: fixed;
: 화면이 스크롤 되더라도 배경 이미지는 스크롤 되지 않고 고정되어있게 함
background-position: 0% 0%;
로 배경 이미지는 우측 상단에 위치background-position: letf top;
: 요소의 배경 색상 지정, 색상값 또는 tranparent 키워드를 지정할 수 있다.
: background-color, background-image, background-repeat, background-position을 한번에 정의하기 위한 shorthand syntax
background: color url(" ") repeat attachment position;
Reference