The Bootstrap navigation bar is one of the components that is used on a majority of sites using the Bootstrap framework. When creating an ASP.NET MVC website in Visual Studio, the default template generates all the HTML markup necessary for a standard navigation bar. The Bootstrap navigation bar looks like the following screenshot:
The following code inside the _Layout.cshtml
file creates a fixed-top
navigation bar, which is also responsive. When the site is opened on a device with a smaller screen size, it will display a button with three bars, and when you click on it, it will show the menu vertically:
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span...