Add buttons in Bootstrap Navbar

Add buttons using class .navbar-btn to <button> elements. You can try to run the following code to add a button to the navbar


Live Demo

<!DOCTYPE html>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
      <nav class = "navbar navbar-default" role = "navigation" style="background: red;color:white;">
         <div class = "navbar-header">
            <a class = "navbar-brand" href = "#">Example</a>
            <form class = "navbar-form navbar-left" role = "search">
               <div class = "form-group">
                  <input type = "text" class = "form-control" placeholder = "Search here...">
               <button type = "submit" class = "btn btn-default">Submit Button</button>
            <button type = "button" class = "btn btn-default navbar-btn">Navbar Button</button>
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know