본문 바로가기
Programming/CSS

background 속성

by wonduk 2023. 6. 15.
728x90

background에서 url 이미지 가져오는 방법

background-image: url(rice.png);
background-repeat: no-repeat;

repeat 속성

repeat: 이미지가 작으면 반복,

repeat-x : x축반복

repeat-y : y축반복 no-repeat: 반복 안 함

background-position: left; 배경 이미지 위치설정

★ background- 4가지 속성을 한번에 적는 방법

background: yellow url(rice.png) no-repeat left;

색 이미지 리피트 position

백그라운드사이즈 설정 :

background-size: cover cover는 box의 전체에 맞게 설정해 줌 position은 center로 설정해주는게 좋음 contain -원본이미지에 가장 맞는 가로세로를 설정

728x90

'Programming > CSS' 카테고리의 다른 글

마진 병합 현상  (0) 2023.06.15
box model  (0) 2023.06.15
font 속성  (0) 2023.06.15
CSS Selector  (0) 2023.06.15
인터널, 익스터널, 인라인  (0) 2023.06.15