Categories

Friday, March 29, 2024
#919814419350 therichposts@gmail.com
Angular 8Angular 9Angular7Bootstrap 4

How to make navbar sticky in Angular 9?

How to make business template with Bootstrap 4 and Angular 9?

Hello to all, welcome on therichpost.com. In this post, I will tell you, How to make navbar sticky in Angular 9?

Post Working:

I am using Bootstrap 4 into my angular 9 application and just added one class, bootstrap 4 navbar changes to sticky.

Here is the working code and please use carefully:

1. Here is the class that I have added to my Bootstrap 4 navbar into my Angular 9 application(app.component.html file):

<nav class="navbar navbar-expand-md bg-dark navbar-dark sticky-top">
  <a class="navbar-brand" routerLink="/users">Home</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" routerLink="/adduser">Add User</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" routerLink="/users">Users</a>
      </li>
    </ul>
  </div>  
</nav>

 

Here is the class name : sticky-top that we need to add into navbar.

If you have any kind of query then please do comment below.

Jassa

Thak you

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.