active-scroll-navigation
Version:
Navigation will change active state when user scroll.
41 lines (38 loc) • 612 B
CSS
body{
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
padding: 0;
margin: 0;
font-size: 18px;
}
nav{
position: fixed;
background: rgba(0,0,0, .2);
width: 100%;
top:0;
padding: 10px 0;
display: flex;
justify-content: center;
z-index: 99;
}
nav a{
margin: 0 15px;
text-decoration: none;
color: #000;
text-transform: uppercase;
font-weight: 400;
font-size: 20px;
}
nav a.main-nav__item--active{
color: #4286f4;
}
section{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
#section1,
#section3{
background: #e5e6e8;
}