Bootstrap 表單輸入


最常見的表單文字欄位是輸入欄位。在這裡,使用者將輸入大部分必要的表單資料。Bootstrap 為所有本機 HTML5 輸入型別提供支援: text、password、datetime、datetime-local、date、month、time、week、number、email、url、search、tel 和 color。要使Inputs 完全呈現樣式,需要有正確的type 宣告。

 你可以嘗試執行以下程式碼,瞭解如何在 Bootstrap 中使用表單輸入

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Form Input</title>
      <meta name = "viewport" content="width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
   </head>
   <body>
      <form role = "form">
         <div class = "form-group">
            <label for = "name">Player</label>
            <input type = "text" class = "form-control" placeholder = "Player Name">
         </div>
         <div class = "form-group">
            <label for = "name">Rank</label>
            <input type = "text" class = "form-control" placeholder = "Player Rank">
         </div>
      </form>
   </body>
</html>

更新於:2020 年 6 月 12 日

182 次瀏覽

開啟 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.