Let's put this into a class: #main-nav.sticky {position: fixed; top: 0;} Next we need to add this class to the #main-nav element when the user scrolls past it. Change padding-top and padding-bottom and define line-height for uncollapsed navbar links. The navbar-toggler class is used for navigation bar toggling or responsive navbar. There are several included Navbar color schemes to Bootstrap 4. You can specify the background color using the bg- classes: bg-light, bg-dark, bg-info, bg-danger, bg-primary, bg-warning, or bg-success. Usenavbar-dark for lighter text color (white), or navbar-light for darker text color (black). Then, customize with .bg-* utilities. Change padding-top and padding-bottom and define line-height for uncollapsed navbar links. Because the navbar's parent isn't body, we'll actually have to use position: fixed to stick the navbar to the top of the screen. Change Navbar Text Color on Scroll - Codeconvey Bootstrap provides two styles that you may specify in the