div {
background-image: url(/image.jpg);
background-repeat: no-repeat; /* 반복 수행 X */
}
background-position: 방향1 방향2;
/* 순서를 바꿔도 된다 */
background-position: 방향2 방향1;
/* center 일 경우 한번만 써도 됨 */
background-position: center;
background-position: x축 y축;
/* 순서를 바꾸면 안됨 */
background-position: 50px bottom
background-position: left 50px
background-attachment: fixed
background-attachment: local
<div class="container">
<div class="for-scroll"></div>
</div>
.container {
width: 400px;
height: 500px;
background-image: url("...");
background-attachment: local;
}
.for-scroll {
height: 200px;
}
프론트엔드 올인원 패키지 바로가기 -> https://bit.ly/3m0t8GM