티스토리 뷰
body {
background-color: red;
}
background-image: url('경로');
반복은 background-repeat: no-repeat, repeat-x, repeat-y, repeat로 제어가능
background-size: (배경의 크기 지정 가능)
ex. background-size: cover;
background-position: 배경 이미지가 요소 내에서 어디에 위치할지 지정 가능 (left, right, top, bottom, center)
ex. background-position: center center;
background-attachment: fixed → 스크롤의 움직임에 따라 화면 고정
→ background: url('.경로') no-repeat center/cover fixed; 이와 같은 형태로 한번에 나타내기도 가능
가독성이 떨어지므로 비추천
'Web > CSS' 카테고리의 다른 글
CSS - 전환 효과 속성 (0) | 2024.02.17 |
---|---|
CSS - 위치 속성 (0) | 2024.02.17 |
CSS - 박스 모델 (0) | 2024.02.17 |
CSS - 적용 우선순위와 개별성 (0) | 2024.02.16 |
CSS - 선택자 다루기 (0) | 2024.02.16 |