인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

Youngjae Choi님의 프로필 이미지
Youngjae Choi

작성한 질문수

HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)

25.Pure CSS 콘텐츠 슬라이더 프로토타입 02 (풀스크린 탭 콘텐츠 슬라이더 응용)

background 관련 질문입니다.

작성

·

169

1

.items div:nth-child(1) {
backgroundurl('images/photo-01.jpg'no-repeat center center;
background-attachmentfixed;
background-sizecover;
}
.items div:nth-child(2) {
backgroundurl('images/photo-02.jpg'no-repeat center center;
background-attachmentfixed;
background-sizecover;
}
.items div:nth-child(3) {
backgroundurl('images/photo-03.jpg'no-repeat center center;
background-attachmentfixed;
background-sizecover;
}

위에서 공통되는 부분을,

.items div {}

여기에 넣으니,

background-attachment: fixed; 와 background: cover; 가 작동 하지 않더라구요.

왜인지 혹시 알 수 있을까요?

제가 놓치고 있는 뭔가가 있을까 궁금합니다.

다른분들의 질답을 잘 챙겨보고 있습니다.

저는 강의보기 전에, 먼저 혼자 만들어보고, 막히면 몇번 더 해보고, 강의를 보고 다시 따라하며,  여러번 연습을 합니다.

질문하고 나서도 또 혼자 해보겠지만, 그러면서 늘겠죠 ^^;;

답변 1

1

Youngjae Choi님의 프로필 이미지
Youngjae Choi
질문자

새로 다시 해보니 위 질문드린것과 같이,

저부분들을 따로 공통으로 빼니, 작동자체가 안되었습니다. 무조건 같이 써줘야 하는 것 같습니다. 이유는 잘모르겠지만, background:url();과 같이 적어줘야만 작동하는 것 같습니다.

Youngjae Choi님의 프로필 이미지
Youngjae Choi

작성한 질문수

질문하기