1<nav class="navbar navbar-expand-lg navbar-light bg-light">
2 <a class="navbar-brand" href="#">Navbar</a>
3 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
4 <span class="navbar-toggler-icon"></span>
5 </button>
6
7 <div class="collapse navbar-collapse" id="navbarSupportedContent">
8 <ul class="navbar-nav mr-auto">
9 <li class="nav-item active">
10 <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
11 </li>
12 <li class="nav-item">
13 <a class="nav-link" href="#">Link</a>
14 </li>
15 <li class="nav-item dropdown">
16 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
17 Dropdown
18 </a>
19 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
20 <a class="dropdown-item" href="#">Action</a>
21 <a class="dropdown-item" href="#">Another action</a>
22 <div class="dropdown-divider"></div>
23 <a class="dropdown-item" href="#">Something else here</a>
24 </div>
25 </li>
26 <li class="nav-item">
27 <a class="nav-link disabled" href="#">Disabled</a>
28 </li>
29 </ul>
30 <form class="form-inline my-2 my-lg-0">
31 <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
32 <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
33 </form>
34 </div>
35</nav>
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <title>Bootstrap Example</title>
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
8 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
9 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
10</head>
11<body>
12
13<nav class="navbar navbar-inverse">
14 <div class="container-fluid">
15 <div class="navbar-header">
16 <a class="navbar-brand" href="#">WebSiteName</a>
17 </div>
18 <ul class="nav navbar-nav">
19 <li class="active"><a href="#">Home</a></li>
20 <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
21 <ul class="dropdown-menu">
22 <li><a href="#">Page 1-1</a></li>
23 <li><a href="#">Page 1-2</a></li>
24 <li><a href="#">Page 1-3</a></li>
25 </ul>
26 </li>
27 <li><a href="#">Page 2</a></li>
28 </ul>
29 <ul class="nav navbar-nav navbar-right">
30 <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
31 <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
32 </ul>
33 </div>
34</nav>
35
36<div class="container">
37 <h3>Right Aligned Navbar</h3>
38 <p>The .navbar-right class is used to right-align navigation bar buttons.</p>
39</div>
40
41</body>
42</html>
43
1//an example of a bootstrap nav bar which you can use as a boilerplate code
2<nav class="navbar navbar-expand-lg navbar-light bg-light">
3 <a class="navbar-brand" href="#">Navbar</a>
4 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
5 <span class="navbar-toggler-icon"></span>
6 </button>
7
8 <div class="collapse navbar-collapse" id="navbarSupportedContent">
9 <ul class="navbar-nav mr-auto">
10 <li class="nav-item active">
11 <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
12 </li>
13 <li class="nav-item">
14 <a class="nav-link" href="#">Link</a>
15 </li>
16 <li class="nav-item dropdown">
17 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
18 Dropdown
19 </a>
20 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
21 <a class="dropdown-item" href="#">Action</a>
22 <a class="dropdown-item" href="#">Another action</a>
23 <div class="dropdown-divider"></div>
24 <a class="dropdown-item" href="#">Something else here</a>
25 </div>
26 </li>
27 <li class="nav-item">
28 <a class="nav-link disabled" href="#">Disabled</a>
29 </li>
30 </ul>
31 <form class="form-inline my-2 my-lg-0">
32 <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
33 <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
34 </form>
35 </div>
36</nav>
1<nav class="navbar navbar-expand-lg navbar-light bg-light">
2 <div class="container-fluid">
3 <a class="navbar-brand" href="#">Navbar</a>
4 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
5 <span class="navbar-toggler-icon"></span>
6 </button>
7 <div class="collapse navbar-collapse" id="navbarSupportedContent">
8 <ul class="navbar-nav me-auto mb-2 mb-lg-0">
9 <li class="nav-item">
10 <a class="nav-link active" aria-current="page" href="#">Home</a>
11 </li>
12 <li class="nav-item">
13 <a class="nav-link" href="#">Blogs</a>
14 </li>
15 </ul>
16 <form class="d-flex">
17 <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
18 <button class="btn btn-outline-success" type="submit">Search</button>
19 </form>
20 </div>
21 </div>
22</nav>