배경과 글씨, 버튼을 고정시키는 경우 전체 section 에 해당하는 부분에 background-image 를 넣고
그 위에 글씨(img), 버튼(a) 위치를 잡아주면 된다. (position: absolute 후 위치 잡기)
* css code 2
/* Pick your Favorite */.pick-your-favorite {
background-image: url("../images/favorite_bg.jpg");
background-repeat: no-repeat;
background-position: center;
/* Parallax */background-attachment: fixed;
/* 스크롤 될 때 같이 움직이지 않는 구조 */background-size: cover;
/* 배경의 이미지를 요소의 더 넓은 너비에 맞춰서 출력 */
}
.pick-your-favorite.inner {
padding: 110px0;
}
.pick-your-favorite.text-group {
width: 362px;
display: flex;
flex-wrap: wrap;
/* 줄 바꿈이 가능 */justify-content: flex-end;
/* 해당하는 영역의 우측 정렬 */
}
.pick-your-favorite.text-group.title {
margin-bottom: 40px;
}
.pick-your-favorite.text-group.description {
margin-bottom: 40px;
}
입체감을 주는 Parallax css code, 생각보다 간단하다.
마찬가지로 background-image를 넣고, 만약 높이가 있다면 높이 설정(없으면 생략)