Ilọsiwaju
Iwe ati awọn apẹẹrẹ fun lilo awọn ọpa ilọsiwaju aṣa Bootstrap ti n ṣe afihan atilẹyin fun awọn ifi tolera, awọn ipilẹ ere idaraya, ati awọn aami ọrọ.
Bawo ni o ṣe n ṣiṣẹ
Awọn paati ilọsiwaju jẹ itumọ pẹlu awọn eroja HTML meji, diẹ ninu CSS lati ṣeto iwọn, ati awọn abuda diẹ. A ko lo eroja HTML5<progress>
, ni idaniloju pe o le to awọn ọpa ilọsiwaju pọ, ṣe ere wọn, ati gbe awọn aami ọrọ si wọn.
- A lo
.progress
bi ipari lati ṣe afihan iye ti o pọju ti ọpa ilọsiwaju. - A lo inu
.progress-bar
lati fihan ilọsiwaju ti o jina. - Awọn
.progress-bar
nilo ara opopo, kilasi ohun elo, tabi CSS aṣa lati ṣeto iwọn wọn. - Ohun naa
.progress-bar
tun nilo diẹ ninurole
ati awọnaria
abuda lati jẹ ki o wa.
Fi gbogbo rẹ papọ, ati pe o ni awọn apẹẹrẹ wọnyi.
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Bootstrap pese iwonba awọn ohun elo fun eto iwọn . Ti o da lori awọn iwulo rẹ, iwọnyi le ṣe iranlọwọ pẹlu atunto ilọsiwaju ni iyara.
<div class="progress">
<div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Awọn akole
Ṣafikun awọn aami si awọn ifi ilọsiwaju rẹ nipa gbigbe ọrọ si inu faili .progress-bar
.
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
</div>
Giga
A ṣeto height
iye nikan lori .progress
, nitorina ti o ba yi iye yẹn pada, inu .progress-bar
yoo ṣe atunṣe laifọwọyi ni ibamu.
<div class="progress" style="height: 1px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress" style="height: 20px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Awọn ipilẹṣẹ
Lo awọn kilasi IwUlO abẹlẹ lati yi irisi awọn ifi ilọsiwaju kọọkan pada.
<div class="progress">
<div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar bg-info" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar bg-warning" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Awọn ifipa pupọ
Fi awọn ifi ilọsiwaju lọpọlọpọ sinu paati ilọsiwaju ti o ba nilo.
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 15%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-success" role="progressbar" style="width: 30%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-info" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Ṣiṣiri
Ṣafikun .progress-bar-striped
si eyikeyi .progress-bar
lati lo adikala kan nipasẹ gradient CSS lori awọ abẹlẹ ọpa ilọsiwaju.
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-info" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-warning" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Ti ere idaraya orisirisi
Didient ṣi kuro tun le ṣe ere idaraya. Fikun -un .progress-bar-animated
lati .progress-bar
mu awọn ila si ọtun si osi nipasẹ awọn ohun idanilaraya CSS3.
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
</div>