允許使用標籤來進行 Bootstrap 的表單驗證


在 Bootstrap 中使用 .control-label 類來允許使用標籤進行表單驗證。

你可以嘗試執行以下程式碼,在 Bootstrap 中實現 control-label 類

示例

現場演示

<!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>
      <div class = "container">
         <form class = "form-horizontal">
            <div class = "form-group">
               <label class = "control-label col-sm-2" for="email">Email-</label>
               <div class = "col-sm-10">
                  <p class = "form-control-static">amit@demo.com</p>
               </div>
            </div>
         </form>
      </div>
   </body>
</html>

更新於:12-6-2020

144 次瀏覽

啟動你的 職業生涯

透過完成課程獲取認證

開始
廣告
© . All rights reserved.