Go bifo
Dokumɛnt ɛn ɛgzampul dɛn fɔ yuz Bootstrap kɔstɔm prɔgrɛs ba dɛn we gɛt sɔpɔt fɔ stak ba dɛn, animɛt bakgrɔn dɛn, ɛn tɛks lɛbl dɛn.
Dɛn bil di prɔgrɛs kɔmpɔnɛnt dɛn wit tu HTML ɛlimɛnt dɛn, sɔm CSS fɔ sɛt di wit, ɛn sɔm atribyut dɛn. Wi nɔ de yuz di HTML5 <progress>
ɛlimɛnt , fɔ mek shɔ se yu kin stak di prɔgrɛs bar dɛn, animate dɛn, ɛn put tɛks lɛbl dɛn oba dɛn.
- Wi de yuz di
.progress
as a wrapper fɔ sho di maks valyu fɔ di prɔgrɛs bar. - Wi de yuz di insay
.progress-bar
fɔ sho di prɔgrɛs we dɔn de te naw. - Di
.progress-bar
nid fɔ gɛt inlayn stayl, yutiliti klas, ɔ kɔstɔm CSS fɔ sɛt dɛn wit. - Di
.progress-bar
tu nid sɔmrole
ɛnaria
atribyut dɛn fɔ mek i aksesbul.
Put dat ɔl togɛda, ɛn yu gɛt dɛn ɛgzampul dɛn ya.
<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 de gi wan anful yutiliti fɔ sɛt wit . Dipen pan wetin yu nid, dɛn tin ya kin ɛp fɔ kɔnfigyut di prɔgrɛs kwik kwik wan.
<div class="progress">
<div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Ad lɛbl dɛn to yu prɔgrɛs bar dɛn bay we yu put tɛks insay di .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>
Wi jɔs de sɛt height
valyu pan di .progress
, so if yu chenj da valyu de di insay .progress-bar
go ɔtomɛtik chenj di sayz akɔdin to am.
<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>
Yuz bakgrɔn yutiliti klas dɛn fɔ chenj di we aw wan wan prɔgrɛs bar dɛn de luk.
<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>
Inklud bɔku prɔgrɛs bar dɛn na wan prɔgrɛs kɔmpɔnɛnt if yu nid.
<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>
Ad .progress-bar-striped
to ɛni wan .progress-bar
fɔ aplay wan strɛp via CSS gradient oba di prɔgrɛs bar in bakgrɔn kɔlɔ.
<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>
Di strɛp gradient kin gɛt animashɔn bak. Add .progress-bar-animated
to .progress-bar
fɔ animate di strɛp dɛn rayt to lɛft via CSS3 animashɔn dɛn.