Foundation 進(jìn)度條

2022-08-05 15:09 更新

Foundation 進(jìn)度條可以作為程序處理的程度來顯示:


我們可以在 <div> 元素中使用 .progress 類來創(chuàng)建進(jìn)度條,.meter 類用于子元素(<span>)。我們可以在 <span> 元素中設(shè)置進(jìn)度百分比,如下所示:

實例

<div class="progress">
  <span class="meter" style="width:70%"> </span>
</div>

嘗試一下 ?

進(jìn)度條顏色

默認(rèn)情況下,進(jìn)度條顏色為藍(lán)色。不同顏色的類為:.secondary, .success, 或 .alert:

實例

<div class="progress">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress secondary">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress success">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress alert">
  <span class="meter" style="width:50%"> </span>
</div>

嘗試一下 ?

圓角進(jìn)度條

.radius.round 類用于為進(jìn)度條添加圓角效果:

實例

<div class="progress">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress radius">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress rounded">
  <span class="meter" style="width:50%"> </span>
</div>

嘗試一下 ?

進(jìn)度條尺寸

可以使用 .small-num.large-num 來修改進(jìn)度條的寬度,num 是一個數(shù)字在 1(8.33%) 和 12(default (100%)) 之間:

實例

<div class="progress large-1">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress large-6">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress large-9">
  <span class="meter" style="width:50%"> </span>
</div>

<div class="progress large-11">
  <span class="meter" style="width:50%"> </span>
</div>

<!-- Default width -->
<div class="progress large-12">
  <span class="meter" style="width:50%"> </span>
</div>

嘗試一下 ?

進(jìn)度條標(biāo)簽

可以使用 CSS 為進(jìn)度條添加標(biāo)簽。以下實例中我們添加了<span> 元素來顯示百分比:

實例

 <style>
.percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  color: white;
  transform: translate(-50%, -50%);
  font-size: 12px;
}
</style>

<div class="progress">
  <span class="meter" style="position:relative;width:75%">
    <span class="percentage">75%</span >
  </span>
</div>

<div class="progress success">
  <span class="meter" style="position:relative;width:50%">
    <span class="percentage">50%</span >
  </span>
</div>

<div class="progress alert">
  <span class="meter" style="position:relative;width:25%">
    <span class="percentage">25%</span >
  </span>
</div>

嘗試一下 ?


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號