A navigation header that appears at the top of the page is called a navigation bar:
==== Navigation Bars MUKAVU ====
Basic Navbar
A navigation bar made with Bootstrap can expand or contract based on the size of the screen.
The .navbar class creates a conventional navigation bar, while the .navbar-expand-xl|lg|md|sm responsive collapsing class stacks the navbar vertically on extremely large, large, medium, and small displays.
Use a <ul>element with class=”navbar-nav” to put links within the navbar. Next, include <a> elements with a .nav-link class after <li> elements with a.nav-item class:
For the navigation bar to be centered, use the .justify-content-center class.
On medium, big, and extra large displays, the navigation bar will be centered in the example that follows. Because of the .navbar-expand-smclass, it will appear vertically and left-aligned on small screens:
Link 1Â Â Link 2Â Â Link 3
Example
...
Colored Navbar
To alter the navbar’s background color, use any of the .bg-color classes (.bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark and .bg-light).
Tip: Use the .navbar-dark class to add a white text color to all of the links in the navbar, or the .navbar-light class to add a black text color.
Bootstrap 4 will automatically style pictures with the .navbar-brand class to fit the navbar vertically.
Example
...
Collapsing The Navigation Bar
==== Navigation Bar MUKAVU ====
You typically wish to hide the navigation links and replace them with a button that, when pressed, should display them, especially on small screens.
Use a button with the class=”navbar-toggler”, data-toggle=”collapse”, and data-target=”#thetarget” to create a collapsible navigation bar. After that, enclose the navbar’s content (links, etc.) in a div element with the class=”collapse navbar-collapse”and an id that corresponds to the button’s data-target (“thetarget”).
Include a <form> element with class=”form-inline” to arrange buttons and inputs next to each other:
Example
Other input classes, like .input-group-append or .input-group-prepend, can also be used to add a help text or icon next to the input field. You can read more about these classes in the chapter on Bootstrap Inputs.
==== Navigation Bar MUKAVU ====
Example
Navbar Text
==== Navigation Bar MUKAVU ====
To maintain proper padding and text color, vertically align any non-linking components inside the navbar by using the .navbar-text class.
Additionally, the navigation bar can be fixed to the top or bottom of the page.
Regardless matter how far the page scrolls, a fixed navigation bar remains visible at either the top or bottom.
The navigation bar is fixed at the top thanks to the .fixed-top class:
Example
...
To keep the navbar at the bottom of the page, use the .fixed-bottom class:
==== Navigation Bar MUKAVU ====
Example
...
If you want the navbar to remain at the top of the page even after you scroll past it, use the .sticky-top class. Note: IE11 and older versions of this class will treat it as position:relative and will not function.