Tuesday, January 31, 2023
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 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>
  <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 class="nav-item">
        <a class="nav-link" routerLink="/users">Users</a>


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.


Thak you

the authortherichpost
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 8, Angular 9, Angular 10, Angular 11, Angular12, Angular 13, Angular 14, Angular 15, 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.