Source

Te ahunga whakamua

Ko nga tuhinga me nga tauira mo te whakamahi i nga pae whakamua ritenga a Bootstrap e whakaatu ana i te tautoko mo nga tutaki kua tapae, nga papamuri pakiwaituhi, me nga tapanga kupu.

Me pehea te mahi

Ko nga waahanga o te ahunga whakamua ka hangaia me nga huānga HTML e rua, etahi CSS hei tautuhi i te whanui, me etahi huanga. Kare matou e whakamahi i te huānga HTML5<progress> , me te whakarite ka taea e koe te tarai i nga pae ahunga whakamua, te whakakorikori, me te whakanoho i nga tapanga kuputuhi ki runga.

  • Ka whakamahia e matou te .progresshei takai hei tohu i te uara teitei o te pae ahunga whakamua.
  • Ka whakamahia e matou te roto .progress-barhei tohu i te ahunga whakamua i tenei wa.
  • Ko te .progress-barhiahia he ahua raina, he karaehe whaipainga, he CSS ritenga ranei hei tautuhi i to raatau whanui.
  • Ko .progress-barte hiahia hoki etahi roleme arianga huanga kia uru atu ai.

Whakakotahitia tena, kei a koe nga tauira e whai ake nei.

<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>

Ka whakaratohia e Bootstrap etahi taputapu mo te whakatakoto whanui . I runga i o hiahia, ka awhina pea enei ki te whirihora tere i te ahunga whakamua.

<div class="progress">
  <div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>

Tapanga

Tāpirihia nga tapanga ki o pae ahunga whakamua ma te whakatakoto kupu ki roto i te .progress-bar.

25%
<div class="progress">
  <div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
</div>

Teitei

Ka whakatauhia e matou he heightuara ki runga i te .progress, na ki te whakarereke koe i taua uara .progress-barka huri aunoa te rahi o roto.

<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>

Papamuri

Whakamahia nga karaehe whaipainga papamuri hei whakarereke i te ahua o nga pae ahunga whakamua takitahi.

<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>

Pae maha

Whakauruhia nga pae whakamua maha ki roto i tetahi waahanga ahunga whakamua ki te hiahia koe.

<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>

Tāhekeheke

Taapirihia .progress-bar-stripedki tetahi .progress-barki te hoatu whiu ma te rōnaki CSS ki runga i te tae papamuri o te pae ahunga whakamua.

<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>

Nga whiu pakiwaituhi

Ka taea hoki te whakakorikori i te rōnaki purepure. Taapirihia .progress-bar-animatedki .progress-barte whakakorikori i nga whiu matau ki te maui ma te CSS3 pakiwaituhi.

<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>