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 年 6 月 12 日

194 次瀏覽

助你開啟職業生涯

完成課程獲得認證

開始學習
廣告
© . All rights reserved.