Fixed Navigation Bar on Scroll in CSS


Create a navigation bar that becomes fixed after scrolling past a certain point.

Source Code

.navbar {
    position: relative;
    width: 100%;
}
.navbar.fixed {
    position: fixed;
    top: 0;
    z-index: 100;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments