建立條紋引導進度條


按以下步驟在 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>

更新於: 2020 年 6 月 12 日

483 次瀏覽

開啟您的職業生涯

完成本課程獲取認證

開始學習
廣告