아래 사이트는 각 섹션에서 고정 된 배경 이미지를 사용하지만 각 섹션에 고정 된 콘텐츠 (텍스트, 이미지)를 추가하고 동일한 스크롤 효과를 유지하려면 어떻게해야합니까?고정 콘텐츠 스크롤 레이아웃
내 시도 :
#wrapper {
position: relative;
height: 500px;
width: 500px;
overflow: scroll;
}
.section {
position: relative;
height: 100%;
width: 100%;
}
.content {
position: fixed;
}
#s1 {
background-color: #f00;
}
#s2 {
background-color: #0f0;
}
#s3 {
background-color: #00f;
}
#s1 .content {
}
#s2 .content {
margin-top: -400px;
}
#s3 .content {
margin-top: -800px;
}
<div id="wrapper">
<div class="section" id="s1">
<div class="content">hello1</div>
</div>
<div class="section" id="s2">
<div class="content">hello2</div>
</div>
<div class="section" id="s3">
<div class="content">hello3</div>
</div>
</div>
내가 원하는 무엇 :
http://tympanus.net/Blueprints/ScrollingLayout/
내가 원하는 무엇의 더 나은 아이디어를 얻을 내 예에서보세요 첫 번째 섹션 (빨간색)은 "hello1"만 표시해야합니다.
01 23,516,제 (녹색) 만 "hello2"
번째 (청색) 만 "hello3"
빠른 답장을 보내 주셔서 감사합니다.하지만 내 생각을 이해하지 못했다고 생각합니다. 정확하게 텍스트를 표시하려고합니다. 첫 번째 이미지에는 hello1 만, 두 번째에는 안녕하세요 2 ... – bonell96
@ bonell96 이해, 내 대답을 업데이트했습니다 – jmore009
니스, 고마워요! : D 다른 답변이 없으면 해결책으로 받아 들일 것입니다. – bonell96