溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

bootstrap設(shè)置進(jìn)度條的方法

發(fā)布時(shí)間:2020-09-21 10:12:40 來(lái)源:億速云 閱讀:161 作者:小新 欄目:web開(kāi)發(fā)

這篇文章主要介紹bootstrap設(shè)置進(jìn)度條的方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

1、實(shí)現(xiàn)方法如下:

(1)引入bootrap文件:

 <link rel="stylesheet" href="../libs/bootstrap-3.3.7/css/bootstrap.css">

(2)添加一個(gè)<div class="progress">;

(3)在<div class="progress">中添加一個(gè)<div class="progress-bar">

<div class="progress-bar" aria-valuenow="40" aria-valuemax="100" aria-valuemin="0" style="width:40%;">

aria-valuenow="40"——進(jìn)度條目前進(jìn)度值。

aria-valuemax="100"——最大進(jìn)度值。

aria-valuemin=“0”——最小進(jìn)度值。

style="width:40%;"——讓進(jìn)度條指在40%的位置。

完整代碼如下:

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>進(jìn)度條</title>
    <link rel="stylesheet" href="../libs/bootstrap-3.3.7/css/bootstrap.css">
</head>
<body>
<div style="width: 600px">
    <p>默認(rèn)的進(jìn)度條</p>
    <div>
        <div aria-valuenow="40" aria-valuemax="100" aria-valuemin="0" style="width:40%;">
        </div>
    </div>
</div>
</body>
</html>

以上是實(shí)現(xiàn)一個(gè)默認(rèn)進(jìn)度條,底色的灰色,進(jìn)度顏色是藍(lán)色,我們還可以在默認(rèn)進(jìn)度條的基礎(chǔ)上,通過(guò)加入不同的樣式來(lái)實(shí)現(xiàn)豐富多彩的進(jìn)度條。

2、指定顏色.

progress-bar-success、progress-bar-info、progress-bar-warning、progress-bar-danger

<div class="progress">
    <div class="progress-bar progress-bar-success"style="width: 90%;">
    </div>
</div>
<div class="progress">
    <div class="progress-bar progress-bar-info" style="width: 30%;">
    </div>
</div>
<div class="progress">
    <div class="progress-bar progress-bar-warning" style="width: 20%;">
    </div>
</div>
<div class="progress">
    <div class="progress-bar progress-bar-danger" style="width: 10%;">
    </div>
</div>

bootstrap設(shè)置進(jìn)度條的方法

3、條紋狀,通過(guò)在根div添加 progress-striped 即可

<div class="progress progress-striped">
    <div class="progress-bar progress-bar-success" style="width: 90%;">
    </div>
   </div>

4、在根div 添加active,即可實(shí)現(xiàn)帶動(dòng)畫(huà)的進(jìn)度條?! ?/p>

<div class="progress progress-striped active">
    <div class="progress-bar progress-bar-success" 
         style="width: 40%;">
    </div>
  </div>

以上是bootstrap設(shè)置進(jìn)度條的方法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI