本文實(shí)例為大家分享了bootstrap表單的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <title>表單和圖片</title> <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css" rel="external nofollow" > <link rel="stylesheet" href="css/main.css" rel="external nofollow" > <!--[if lt IE 9]> <script src="lib/html5shiv/html5shiv.min.js"></script> <script src="lib/respond/respond.min.js"></script> <![endif]--> </head> <body> <form> <label>用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼"> </form> <form> <label>用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </form> <!--基本表單--> <form> <div class="form-group"> <label>用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> </div> <div class="form-group"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </div> </form> <!--內(nèi)聯(lián)表單--> <form class="form-inline"><!--當(dāng)屏幕小于768時(shí),變?yōu)閮尚?-> <div class="form-group"> <label>用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> </div> <div class="form-group"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </div> </form> <!--加入input-group-addon--> <form class="form-inline"> <div class="form-group"> <label>用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> </div> <div class="form-group"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </div> <div class="input-group"> <div class="input-group-addon">¥</div> <input type="number" placeholder="請(qǐng)輸入整數(shù)" class="form-control"> <div class="input-group-addon">元</div> </div> </form> <!--水平表單--> <form class="form-horizontal"><!--當(dāng)屏幕小于768時(shí),變?yōu)閮尚?-> <div class="form-group"> <div class="col-sm-2 control-label"> <label>用戶名:</label> </div> <div class="col-sm-10"> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> </div> </div> <div class="form-group"> <div class="col-sm-2 control-label"> <label>密碼:</label> </div> <div class="col-sm-10"> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </div> </div> </form> <!--文本域--> <form> <textarea rows="3"></textarea> </form> <form> <div class="form-group"> <label>文本域</label> <textarea rows="3" class="form-control"></textarea> </div> </form> <!--復(fù)選框--> <form> <input type="checkbox">體育 <input type="checkbox">音樂 <label> <input type="checkbox">體育 </label> <label> <input type="checkbox">音樂 </label> <!--基本復(fù)選框和復(fù)選框設(shè)置禁用--> <div class="checkbox"> <label> <input type="checkbox">體育 </label> </div> <div class="checkbox"> <label> <input type="checkbox">音樂 </label> </div> <div class="checkbox disabled"> <label> <input type="checkbox" disabled>愛好 </label> </div> <!--內(nèi)聯(lián)復(fù)選框--><!--復(fù)選框用法和單選框一樣的--> <label class="checkbox-inline"> <input type="checkbox">體育 </label> <label class="checkbox-inline"> <input type="checkbox">音樂 </label> <label class="checkbox-inline disabled"> <input type="checkbox" disabled>愛好 </label> </form> <!--下拉框--> <form> <select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <select class="form-control"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </form> <!--校驗(yàn)狀態(tài)--> <form> <div class="form-group has-success has-feedback"> <label class="control-label">用戶名:</label> <input type="text" placeholder="請(qǐng)輸入用戶名" class="form-control"> <span class="glyphicon glyphicon-ok form-control-feedback"></span> </div> <div class="form-group"> <label>密碼:</label> <input type="password" placeholder="請(qǐng)輸入密碼" class="form-control"> </div> </form> <script src="lib/jquery/jquery.js"></script> <script src="lib/bootstrap/js/bootstrap.js"></script> <script src="js/main.js"></script> </body> </html>
新聞熱點(diǎn)
疑難解答
圖片精選