<section>
<p>section01</p>
</section>
<section>
<p>section02</p>
</section>
<section>
<p>section03</p>
</section>
<section>
<p>section04</p>
</section>
<section>
<p>section05</p>
</section>
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
p {
font-size: 20px;
}
section {
width: 100%;
height: 100vh;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
}
section:nth-child(2) {
background: #a0dde2;
}
section:nth-child(3) {
background: #e2a0b4;
}
section:nth-child(4) {
background: #eec496;
}
section:nth-child(5) {
background: #a0e2c2;
}
section {
position: sticky;
top: 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.