"navbar sticky top"
Bootstrap 4.1.1 Snippet by PaataKurdadze

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> </head> <body style="height:1500px;"> <div class="jumbotron"> <br> <h3>Sticky Navbar</h3> <p>A sticky navigation bar stays fixed at the top of the page when you scroll past it.</p> <p>Scroll this page to see the effect. <strong>Note:</strong> sticky-top does not work in IE11 and earlier.</p> </div> <nav class="navbar navbar-expand-sm bg-dark navbar-dark sticky-top"> <a class="navbar-brand">Logo</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="collapsibleNavbar"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link" href="#">Link 1</a> </li> <li class="navbar-item"> <a class="nav-link" href="#">Link 2</a> </li> </ul> <span class="navbar-text">Navbar Text</span> </div> </nav> <br> <div class="container"> <h3>Navbar Text</h3> <p>Use the .navbar-text class to vertical align any elements inside the navbar that are not links (ensures proper padding).</p> </div> </body> </html>

Related: See More


Questions / Comments: