建立條紋引導進度條
按以下步驟在 Bootstrap 中建立條紋進度條 −
- 增加一個具有 .progress 和 .progress-striped 類的 <div>。
- 接著,在上述 <div> 內,增加一個具有 .progress-bar 和進度條-* 類的空 <div>,其中 * 可能為 success、info、warning、danger。
- 增加一個使用百分比表示寬度的 style 特性。例如,style = "60%"; 表示進度條處於 60%。
你可以嘗試執行以下程式碼,以形成一個條紋進度條 −
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <h2>Striped Progress Bars</h2> <h3>Warning Progress Bar</h3> <div class = "progress progress-striped"> <div class = "progress-bar progress-bar-warning" role = "progressbar" aria-valuenow = "45" aria-valuemin = "0" aria-valuemax = "100" style="width: 45%;"> <span class = "sr-only">45%Complete (warning)</span> </div> </div> <h3>Danger Progress Bar</h3> <div class = "progress progress-striped"> <div class = "progress-bar progress-bar-danger" role = "progressbar" aria-valuenow = "80" aria-valuemin = "0" aria-valuemax = "100" style = "width: 80%;"> <span class = "sr-only">80% Complete (danger)</span> </div> </div> </body> </html>
廣告