本文實(shí)例為大家分享了Bootstrap表單布局的具體代碼,供大家參考,具體內(nèi)容如下
Bootstrap 提供了下列類型的表單布局:
垂直表單(默認(rèn))
內(nèi)聯(lián)表單
水平表單
小妞妞做的表單實(shí)例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 教學(xué)意見調(diào)查表</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" > <style> body { padding-top: 150px; padding-bottom: 40px; background-color: #D0E9C6; font-family: '楷體'; font-size: 22px; } .col-sm-2 control-label.form-control{ position: relative; height: 60px; -moz-box-sizing: border-box; box-sizing: border-box; } .form-horizontal{ max-width:800px; padding: 15px; margin: 0 auto; } </style> </head> <body> <div class="container"> <form class="form-horizontal" role="form" action="#" method="post"> <div class="form-group"> <label for="name" class="col-sm-2 control-label">名字</label> <div class="col-sm-10"> <input type="text" class="form-control" id="firstname" placeholder="請(qǐng)輸入名字"> </div> </div> <div class="form-group"> <label for="class" class="col-sm-2 control-label">班級(jí)</label> <div class="col-sm-10"> <input type="text" class="form-control" id="lastname" placeholder="請(qǐng)輸入班級(jí)"> </div> </div> <div class="form-group"> <label for="Student ID" class="col-sm-2 control-label">學(xué)號(hào)</label> <div class="col-sm-10"> <input type="text" class="form-control" id="Student ID" placeholder="請(qǐng)輸入學(xué)號(hào)"> </div> </div> <div class="form-group"> <label for="kemu" class="col-sm-2 control-label">科目名稱</label> <div class="col-sm-10"> <input type="text" class="form-control" id="kemu" placeholder="請(qǐng)輸入科目名稱"> </div> </div> <div class="form-group"> <label for="name2" class="col-sm-2 control-label">意見</label> <div class="col-sm-10"> <input type="text" class="form-control" rows="3"> </div> </div> <div align="center"> <input type="submit" class="btn-success" style="border-radius:5px; width: 120px;" value="提交" /> <input type="button" class="btn-info" style="border-radius:5px; width: 120px;" value="取消" /> </div> </form> </div> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html> 效果圖:

參考地址:http://www.w3cschool.cn/bootstrap/bootstrap-v2-forms.html
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持VeVb武林網(wǎng)。
新聞熱點(diǎn)
疑難解答