Hello, Welcome Here
Navigation Bars
A standard navigation bar is created with <nav class="navbar navbar-default">
.
Inverted Navigation Bar
Just change the .navbar-default
class into .navbar-inverse
:
Navigation Bar With Dropdown
The following example adds a dropdown menu for the "Page 1" button:
Right-Aligned Navigation Bar
The .navbar-right
class is used to right-align navigation bar buttons.
Navbar Buttons
To add buttons inside the navbar, add the .navbar-btn
class on a Bootstrap button:
Navbar Forms
To add form elements inside the navbar, add the .navbar-form
class to a form element and add an input(s). Note that we have added a .form-group
class to the div container holding the input. This adds proper padding if you have more than one inputs (you will learn more about this in the Forms chapter).
Navbar Input Addons
You can also use the .input-group
and .input-group-addon
classes to attach an icon or help text next to the input field. You will learn more about these classes in the Bootstrap Inputs chapter.
Navbar Text
Use the .navbar-text
class to vertical align any elements inside the navbar that are not links (ensures proper padding and text color).
Fixed Navigation Bar
The .navbar-fixed-bottom
class makes the navigation bar stay at the bottom:
Navigation Bars
A standard navigation bar is created with <nav class="navbar navbar-default">
.
Inverted Navigation Bar
Just change the .navbar-default
class into .navbar-inverse
:
Navigation Bar With Dropdown
The following example adds a dropdown menu for the "Page 1" button:
Right-Aligned Navigation Bar
The .navbar-right
class is used to right-align navigation bar buttons.
Navbar Buttons
To add buttons inside the navbar, add the .navbar-btn
class on a Bootstrap button:
Navbar Forms
To add form elements inside the navbar, add the .navbar-form
class to a form element and add an input(s). Note that we have added a .form-group
class to the div container holding the input. This adds proper padding if you have more than one inputs (you will learn more about this in the Forms chapter).
Navbar Input Addons
You can also use the .input-group
and .input-group-addon
classes to attach an icon or help text next to the input field. You will learn more about these classes in the Bootstrap Inputs chapter.
Navbar Text
Use the .navbar-text
class to vertical align any elements inside the navbar that are not links (ensures proper padding and text color).
Fixed Navigation Bar
The .navbar-fixed-bottom
class makes the navigation bar stay at the bottom: