bootstrap中添加額外的圖標(biāo)實例代碼
更新時間:2017年02月15日 16:57:45 投稿:mrr
可以針對校驗狀態(tài)為輸入框添加額外的圖標(biāo)。接下來通過本文給大家分享bootstrap中添加額外的圖標(biāo)實例代碼,需要的的朋友參考下吧
說明
可以針對校驗狀態(tài)為輸入框添加額外的圖標(biāo)。只需設(shè)置相應(yīng)的 .has-feedback 類并添加正確的圖標(biāo)即可
示例
<!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"> <!-- 上述3個meta標(biāo)簽*必須*放在最前面,任何其他內(nèi)容都*必須*跟隨其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" rel="external nofollow" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="form-group has-success has-feedback"> <label class="control-label" for="inputSuccess2">Input with success</label> <input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status"> <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> <span id="inputSuccess2Status" class="sr-only">(success)</span> </div> <div class="form-group has-warning has-feedback"> <label class="control-label" for="inputWarning2">Input with warning</label> <input type="text" class="form-control" id="inputWarning2" aria-describedby="inputWarning2Status"> <span class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span> <span id="inputWarning2Status" class="sr-only">(warning)</span> </div> <div class="form-group has-error has-feedback"> <label class="control-label" for="inputError2">Input with error</label> <input type="text" class="form-control" id="inputError2" aria-describedby="inputError2Status"> <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span> <span id="inputError2Status" class="sr-only">(error)</span> </div> <div class="form-group has-success has-feedback"> <label class="control-label" for="inputGroupSuccess1">Input group with success</label> <div class="input-group"> <span class="input-group-addon">@</span> <input type="text" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status"> </div> <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> <span id="inputGroupSuccess1Status" class="sr-only">(success)</span> </div> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> </body> </html>
輸出
以上所述是小編給大家介紹的bootstrap中添加額外的圖標(biāo)實例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
您可能感興趣的文章:
- 本地Bootstrap文件字體圖標(biāo)引入?yún)s無法顯示問題的解決方法
- Bootstrap字體圖標(biāo)無法正常顯示的解決方法
- BootStrap glyphicon圖標(biāo)無法顯示的解決方法
- Bootstrap3 input輸入框插入glyphicon圖標(biāo)的方法
- bootstrap布局中input輸入框右側(cè)圖標(biāo)點擊功能
- BootStrap glyphicons 字體圖標(biāo)實現(xiàn)方法
- JS組件系列之Bootstrap Icon圖標(biāo)選擇組件
- 很不錯的兩款Bootstrap Icon圖標(biāo)選擇組件
- 詳解Bootstrap glyphicons字體圖標(biāo)
相關(guān)文章
bootstrap-table組合表頭的實現(xiàn)方法
本篇文章主要介紹了bootstrap-table組合表頭的實現(xiàn)方法,非常具有實用價值,需要的朋友可以參考下2017-09-09js實現(xiàn)的日期操作類DateTime函數(shù)代碼
感覺js自帶的Date類型對象用起來不是很方便,照著C#的DateTime做了一個2010-03-03Echart結(jié)合圓形實現(xiàn)儀表盤的繪制詳解
EChart開源來自百度商業(yè)前端數(shù)據(jù)可視化團隊,基于html5?Canvas,是一個純Javascript圖表庫,提供直觀,生動,可交互,可個性化定制的數(shù)據(jù)可視化圖表。本文將利用EChart實現(xiàn)儀表盤的繪制,感興趣的可以學(xué)習(xí)一下2022-03-03JavaScript中Array的filter函數(shù)詳解
這篇文章主要介紹了JavaScript中Array的filter函數(shù)詳解,filter?為數(shù)組中的每個元素調(diào)用一次callback函數(shù),W更多具體內(nèi)容,需要的朋友可以參考一下2022-07-07