<nav class="nav">
<a href="#section1" class="btn">section 01</a>
<a href="#section2" class="btn">section 02</a>
<a href="#section3" class="btn">section 03</a>
</nav>
<div class="full-page" id="section1">section 01</div>
<div class="full-page" id="section2">section 02</div>
<div class="full-page" id="section3">section 03</div>
html {
scroll-behavior: smooth;
}
.nav {
padding: 0.75rem 1rem;
background-color: #ddd;
display: flex;
justify-content: space-around;
position: sticky;
top: 0;
}
.btn {
display: inline-block;
background-color: #ccc;
color: #444;
text-decoration: none;
padding: 0.25rem 1.2rem;
border-radius: 10px;
}
.full-page {
height: 100vh;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: center;
align-items: center;
text-transform: uppercase;
font-weight: 800;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.