 |
Bootstrap 4 Navbar |
The Navbar is shown on each page that the user navigates through the website. The bootstrap 4 nav component provides the different styles of the navbar. It also supports logo branding, easy navigation, quote buttons, and forms, etc.. Let's look into each one with an example.
The Navbar completely supports responsiveness depending on various screen sizes. To create default navbar, use
.navbar class along with responsive class
.navbar-expand-sm|md|lg|xl. To create menu items with the hyperlink, Add
.navbar-nav class to your
<ul> element and add
.nav-item class to your each
<li> element inherited by an
<a> element with
.nav-link class for hyperlink.
Navbar with Background
To create navbar with color variation, include any of the contextual classes (
.bg-primary,
.bg-secondary,
.bg-warning,
.bg-danger,
.bg-success,
.bg-light,
.bg-dark,
.bg-info) to your navbar.
Navbar with Dropdown
Navbar with Forms and Buttons
You can include inline forms or buttons to your navbar.
Navbar Position - Default
Navbar Position - Fixed Top
Navbar Position - Fixed Bottom
Navbar Position - Sticky Top
Navbar External Content
The Navbar not only used as a menu, but it can also be used as an accordion toggle to show/hide external content. Here's an example of navbar external content,
Comments