Bootstrap實(shí)現(xiàn)各種進(jìn)度條樣式詳解
一:默認(rèn)的進(jìn)度條
創(chuàng)建一個(gè)基本的進(jìn)度條的步驟如下:
- 添加一個(gè)帶有 class .progress 的 <div>。
- 接著,在上面的 <div> 內(nèi),添加一個(gè)帶有 class .progress-bar 的空的 <div>。
- 添加一個(gè)帶有百分比表示的寬度的 style 屬性,例如 style="60%"; 表示進(jìn)度條在 60% 的位置。
讓我們看看下面的實(shí)例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例 - 進(jìn)度條</title> <link href="/bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 40%;"> <span class="sr-only">40% 完成</span> </div> </div> </body> </html>
結(jié)果如下所示:
二:交替的進(jìn)度條
創(chuàng)建不同樣式的進(jìn)度條的步驟如下:
- 添加一個(gè)帶有 class .progress 的 <div>。
- 接著,在上面的 <div> 內(nèi),添加一個(gè)帶有 class .progress-bar 和 class progress-bar-* 的空的 <div>。其中,* 可以是 success、info、warning、danger。
- 添加一個(gè)帶有百分比表示的寬度的 style 屬性,例如 style="60%"; 表示進(jìn)度條在 60% 的位置。
讓我們看看下面的實(shí)例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例 - 交替的進(jìn)度條</title> <link href="/bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class="progress"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 90%;"> <span class="sr-only">90% 完成(成功)</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 30%;"> <span class="sr-only">30% 完成(信息)</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 20%;"> <span class="sr-only">20% 完成(警告)</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 10%;"> <span class="sr-only">10% 完成(危險(xiǎn))</span> </div> </div> </body> </html>
結(jié)果如下所示:
三:條紋的進(jìn)度條
創(chuàng)建一個(gè)條紋的進(jìn)度條的步驟如下:
- 添加一個(gè)帶有 class .progress 和 .progress-striped 的 <div>。
- 接著,在上面的 <div> 內(nèi),添加一個(gè)帶有 class .progress-bar 和 class progress-bar-* 的空的 <div>。其中,* 可以是 success、info、warning、danger。
- 添加一個(gè)帶有百分比表示的寬度的 style 屬性,例如 style="60%"; 表示進(jìn)度條在 60% 的位置。
讓我們看看下面的實(shí)例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例 - 條紋的進(jìn)度條</title> <link href="/bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class="progress progress-striped"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 90%;"> <span class="sr-only">90% 完成(成功)</span> </div> </div> <div class="progress progress-striped"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 30%;"> <span class="sr-only">30% 完成(信息)</span> </div> </div> <div class="progress progress-striped"> <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 20%;"> <span class="sr-only">20% 完成(警告)</span> </div> </div> <div class="progress progress-striped"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 10%;"> <span class="sr-only">10% 完成(危險(xiǎn))</span> </div> </div> </body> </html>
結(jié)果如下所示:
四:動(dòng)畫(huà)的進(jìn)度條
創(chuàng)建一個(gè)動(dòng)畫(huà)的進(jìn)度條的步驟如下:
- 添加一個(gè)帶有 class .progress 和 .progress-striped 的 <div>。同時(shí)添加 class .active。
- 接著,在上面的 <div> 內(nèi),添加一個(gè)帶有 class .progress-bar 的空的 <div>。
- 添加一個(gè)帶有百分比表示的寬度的 style 屬性,例如 style="60%"; 表示進(jìn)度條在 60% 的位置。
這將會(huì)使條紋具有從右向左的運(yùn)動(dòng)感。
讓我們看看下面的實(shí)例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例 - 動(dòng)畫(huà)的進(jìn)度條</title> <link href="/bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 40%;"> <span class="sr-only">40% 完成</span> </div> </div> </body> </html>
結(jié)果如下所示:
五:堆疊的進(jìn)度條
您甚至可以堆疊多個(gè)進(jìn)度條。把多個(gè)進(jìn)度條放在相同的 .progress 中即可實(shí)現(xiàn)堆疊,如下面的實(shí)例所示:
<!DOCTYPE html> <html> <head> <title>Bootstrap 實(shí)例 - 堆疊的進(jìn)度條</title> <link href="/bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class="progress"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 40%;"> <span class="sr-only">40% 完成</span> </div> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 30%;"> <span class="sr-only">30% 完成(信息)</span> </div> <div class="progress-bar progress-bar-warning" role="<a target="_blank">progressbar</a>" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 20%;"> <span class="sr-only">20% 完成(警告)</span> </div> </div> </body> </html>
結(jié)果如下所示:
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- Bootstrap每天必學(xué)之進(jìn)度條
- BootStrap Progressbar 實(shí)現(xiàn)大文件上傳的進(jìn)度條的實(shí)例代碼
- bootstrap實(shí)現(xiàn)動(dòng)態(tài)進(jìn)度條效果
- BootStrap 實(shí)現(xiàn)各種樣式的進(jìn)度條效果
- BootStrap初學(xué)者對(duì)彈出框和進(jìn)度條的使用感覺(jué)
- Spring Boot+AngularJS+BootStrap實(shí)現(xiàn)進(jìn)度條示例代碼
- bootstrap多種樣式進(jìn)度條展示
- BootStrap組件之進(jìn)度條的基本用法
- Bootstrap進(jìn)度條實(shí)現(xiàn)代碼解析
- jquery 簡(jiǎn)單的進(jìn)度條實(shí)現(xiàn)代碼
- 分享8款優(yōu)秀的 jQuery 加載動(dòng)畫(huà)和進(jìn)度條插件
- bootstrap+jQuery實(shí)現(xiàn)的動(dòng)態(tài)進(jìn)度條功能示例
相關(guān)文章
利用momentJs做一個(gè)倒計(jì)時(shí)組件(實(shí)例代碼)
這篇文章主要介紹了利用momentJs做一個(gè)倒計(jì)時(shí)組件,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-12-12JavaScript運(yùn)行機(jī)制之事件循環(huán)(Event Loop)詳解
這篇文章主要介紹了JavaScript運(yùn)行機(jī)制之事件循環(huán)(Event Loop)詳解,本文從多個(gè)方面講解了Event Loop,需要的朋友可以參考下2014-10-10javascript模版引擎-tmpl的bug修復(fù)與性能優(yōu)化分析
在平時(shí)編碼中,經(jīng)常要做拼接字符串的工作,如把json數(shù)據(jù)用HTML展示出來(lái),以往字符串拼接與邏輯混在在一起會(huì)讓代碼晦澀不堪,加大了多人協(xié)作與維護(hù)的成本。而采用前端模板機(jī)制就能很好的解決這個(gè)問(wèn)題2011-10-10微信小程序?qū)崿F(xiàn)的貪吃蛇游戲【附源碼下載】
這篇文章主要介紹了微信小程序?qū)崿F(xiàn)的貪吃蛇游戲,結(jié)合實(shí)例形式分析了微信小程序?qū)崿F(xiàn)貪吃蛇游戲功能的相關(guān)界面布局與代碼邏輯操作技巧,并附帶源碼供讀者下載參考,需要的朋友可以參考下2018-01-01javascript 判斷頁(yè)面訪問(wèn)方式電腦或者移動(dòng)端
這篇文章主要介紹了 判斷頁(yè)面訪問(wèn)方式電腦或者移動(dòng)端的相關(guān)資料,這里提供了三種方法,需要的朋友可以參考下2016-09-09javascript獲取當(dāng)前的時(shí)間戳的方法匯總
這篇文章主要介紹了javascript獲取當(dāng)前的時(shí)間戳的方法匯總的相關(guān)資料,需要的朋友可以參考下2015-07-07