Ọganihu
Ndekọ na ihe atụ maka iji ogwe ọganihu omenala Bootstrap nke na-egosipụta nkwado maka ogwe ekpokọtara, nzụlite eserese na akara ederede.
Ka o si arụ ọrụ
A na-eji ihe HTML abụọ wuo ihe na-aga n'ihu, ụfọdụ CSS iji tọọ obosara, yana àgwà ole na ole. We don't use the HTML5 <progress>
element , n'ịhụ na ị nwere ike tojupụtara ọganihu ogwe, animate ha, na-etinye ederede akara n'elu ha.
- Anyị na-eji ya
.progress
dị ka ihe mkpuchi iji gosi uru bara ụba nke ogwe ọganihu. - Anyị na-eji n'ime
.progress-bar
gosi ọganihu dị ugbu a. - Nke
.progress-bar
a chọrọ ụdị inline, klaasị ịba uru, ma ọ bụ omenala CSS iji tọọ obosara ha. - Nke
.progress-bar
ahụ na-achọkwa ụfọdụrole
naaria
njirimara iji mee ka ọ nweta ya.
Tinye ihe niile ọnụ, ma ị nwere ihe atụ ndị a.
<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 na-enye obere ngwa ọrụ maka ịtọ obosara . Dabere na mkpa gị, ndị a nwere ike inye aka na ịhazi ọganihu ngwa ngwa.
<div class="progress">
<div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
Akara aha
Tinye akara na ogwe ọganihu gị site na itinye ederede n'ime faịlụ .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>
Ogologo
Naanị ihe anyị na-edobere height
uru na .progress
, yabụ ọ bụrụ na ị gbanwee uru ahụ, nke dị n'ime .progress-bar
ga-agbanwe nha ya ozugbo.
<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>
Ndabere
Jiri klaasị ịba uru n'okirikiri iji gbanwee ọdịdị nke ogwe ọganihu n'otu n'otu.
<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>
Otutu mmanya
Tinye ọtụtụ ogwe ọganihu n'ime akụrụngwa ọganihu ma ọ bụrụ na ịchọrọ.
<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>
Ekewapụrụ
Tinye .progress-bar-striped
na nke ọ bụla .progress-bar
iji tinye eriri site na CSS gradient n'elu agba ndabere mmanya ọganihu.
<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>
Uriri na-emegharị anya
Enwere ike ịmegharị gradient nke eriri. Tinye .progress-bar-animated
ka .progress-bar
ịmegharị ahịrị aka nri gaa n'aka ekpe site na animation 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>
Sass
Mgbanwe
$progress-height: 1rem;
$progress-font-size: $font-size-base * .75;
$progress-bg: $gray-200;
$progress-border-radius: $border-radius;
$progress-box-shadow: $box-shadow-inset;
$progress-bar-color: $white;
$progress-bar-bg: $primary;
$progress-bar-animation-timing: 1s linear infinite;
$progress-bar-transition: width .6s ease;
Igwe igodo
Eji maka imepụta animation CSS maka .progress-bar-animated
. Agụnyere na scss/_progress-bar.scss
.
@if $enable-transitions {
@keyframes progress-bar-stripes {
0% { background-position-x: $progress-height; }
}
}