允许标签用于表单验证,通过 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">[email protected]</p> </div> </div> </form> </div> </body> </html>
广告