3 minutes

Bootstrap Navigation Tabs with Dropdown Menu Example

By Editorial @stacktips, On Sep 17, 2023 Bootstrap 2.62K Views
<!DOCTYPE html> 
<html lang="en">  
<title>My first Bootstrap page </title>    
<meta name="viewport" content="width=device-width, initialscale=1">
<link rel="stylesheet" href=""> 
<script src=""></script>
<script type="text/javascript" src="JS/bootstrap.min.js"></script> 
	<div class="container">
	  <ul class="nav nav-tabs">
	    <li class="active"><a href="#">Home</a></li>
	   <li><a href="#">Android</a></li>
	    <li><a href="#">Bootstrap</a></li>
	    <li><a href="#">About</a></li>        
		<li class="dropdown">
		<a class="dropdown-toggle" data-toggle="dropdown" href="#">
			More <span class="glyphicon glyphicon-option-vertical"></span></a>
		<ul class = "dropdown-menu">
		<li><a href="#">HTML </a></li>
		<li><a href="#">Java Script </a></li>
		<li><a href="#">Xamarine </a></li>	

The output for the above code,
Bootstrap Navigation Tabs with Dropdown Menu


These are indicators to show count of the items you want to highlight. A simple example would be showing the number of unread e-mails or messages. Example, suppose we wanted to display the number of new contents display for each section in our previous example. Add the below code,

<li><a href="#">Android <span class="badge">5</span></a></li>

The output looks like in following way,

Bootstrap Navigation Tabs with Dropdown Menu Badge

stacktips avtar


StackTips provides programming tutorials, how-to guides and code snippets on different programming languages.