Lecture 3
Lecture 3
Lecture 3
Default Navbar
<div class="navbar-header">
<a class="navbar-brand" href="#">TVETI Institute</a>
</div>
<div id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Departments</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
<div class="navbar-header">
<a class="navbar-brand" href="#">TVETI Institute</a>
</div>
<div id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Departments</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
<div id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Departments
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">ICT</a></li>
<li><a href="#">Automotive</a></li>
<li><a href="#">Manufacturing</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
Right-Aligned Navigation Bar
- The .navbar-right class is used to right-align navigation bar buttons.
- In the following example we insert a "My Account" button and a "Logout" button to the right
in the navigation bar. We also add a glyphicon on each of the two new buttons:
<div class="navbar-header">
<a class="navbar-brand" href="#">TVETI Institute</a>
</div>
<div id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Departments
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">ICT</a></li>
<li><a href="#">Automotive</a></li>
<li><a href="#">Manufacturing</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
Example
<div class="collapse navbar-collapse" id="myNavbar">
Bootstrap Sidebar
Sidebar is also a NavBar in Bootstrap that is located at the side of the screen.
Default Sidebar
Example:
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
</div>
</div>
Note: If you have both NavBar and Sidebar in your Bootstrap page, it is recommended that you use
only <class=”navbar-right”> in your NavBar for better responsiveness.