1.

 What does a default navbar consist of?

Answer»

The default navbar is a basic Navigation Bar that use the FOLLOWING class:

class = "navbar navbar-default"

With that, set role as navigation:

<nav class = "navbar navbar-default" role = "navigation">

Now, header class is added, which act as a container for LOGO or header. The logo is added using navbar-brand:

<div class = "navbar-header">     <a class = "navbar-brand" href = "#">Knowledge Hut</a> </div>

Let us see an example now:

<!DOCTYPE html> <html lang="en"> <head>   <TITLE>Bootstrap Example</title>   <meta charset="utf-8">   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <nav class="navbar navbar-default" role = "navigation">   <div class="container-fluid">     <div class="navbar-header">       <a class="navbar-brand" href="#">New WEBSITE</a>     </div>     <ul class="nav navbar-nav">       <li class="active"><a href="#">Home</a></li>       <li><a href="#">AboutUs</a></li>       <li><a href="#">Company</a></li>       <li><a href="#">Services</a></li>       <li><a href="#">Contact</a></li>     </ul>   </div> </nav> </body> </html>

The output: 



Discussion

No Comment Found