Bootstrap navbar-form 类的使用


要在 CSS 中创建导航栏,请使用 navbar-form 类

示例

演示

<!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>

更新日期:2020-06-12

194 浏览

启动您的 职业生涯

通过完成本课程获得认证

入门
广告