允许使用标签来进行 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.