Usage of Bootstrap navbar-form class


To create navbar in CSS, use the navbar-form class

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <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>
   </head>
   <body style = "background: #F5CBA7;">
      <nav class = "navbar navbar-default" role = "navigation">
         <div class = "navbar-header">
            <a class = "navbar-brand" href = "#">My Website</a>
         </div>
         <div>
            <form class = "navbar-form navbar-left" role = "search">
               <div class = "form-group">
                  <input type = "text" class = "form-control" placeholder = "Search">
               </div>
               <button type = "submit" class = "btn btn-default">Submit</button>
            </form>
         </div>
      </nav>
   </body>
</html>

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 12-Jun-2020

154 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements