Akara
Akwụkwọ na ihe atụ maka baajị, obere ọnụ ọgụgụ anyị na akụrụngwa akara.
Ihe atụ
Ọnụọgụ baajị iji dakọọ nha nke mmewere nne na nna ozugbo site na iji nha mkpụrụedemede ikwu na em
nkeji. Dị ka nke v5, baajị enwekwaghị elekwasị anya ma ọ bụ ụdị ntugharị maka njikọ.
Isi okwu
Isi ihe atụỌhụrụ
Isi ihe atụỌhụrụ
Isi ihe atụỌhụrụ
Isi ihe atụỌhụrụ
Isi ihe atụỌhụrụ
Isi ihe atụỌhụrụ
<h1>Example heading <span class="badge bg-secondary">New</span></h1>
<h2>Example heading <span class="badge bg-secondary">New</span></h2>
<h3>Example heading <span class="badge bg-secondary">New</span></h3>
<h4>Example heading <span class="badge bg-secondary">New</span></h4>
<h5>Example heading <span class="badge bg-secondary">New</span></h5>
<h6>Example heading <span class="badge bg-secondary">New</span></h6>
Bọtịnụ
Enwere ike iji baajị dịka akụkụ nke njikọ ma ọ bụ bọtịnụ iji nye counter.
<button type="button" class="btn btn-primary">
Notifications <span class="badge text-bg-secondary">4</span>
</button>
Rịba ama na dabere na otu esi eji ha, baajị nwere ike ịgbagwoju anya maka ndị na-agụ ihuenyo yana teknụzụ enyemaka yiri ya. Ọ bụ ezie na ịke baajị na-enye ihe ngosi anya maka ebumnuche ha, naanị ndị ọrụ a ga-egosipụta ọdịnaya nke baajị ahụ. Dabere na ọnọdụ a kapịrị ọnụ, baajị ndị a nwere ike ịdị ka okwu ma ọ bụ ọnụọgụ agbakwunyere enweghị usoro na njedebe nke ahịrịokwu, njikọ, ma ọ bụ bọtịnụ.
Ọ gwụla ma ihe gbara ya gburugburu doro anya (dị ka ọ dị na ihe atụ “Ọma Ọkwa”, ebe a ghọtara na “4” bụ ọnụọgụ ọkwa), tụlee itinye mgbakwunye mgbakwunye yana mpempe ederede agbakwunyere na anya.
Edoro ya
Jiri akụrụngwa iji gbanwee .badge
ma debe ya n'akụkụ njikọ ma ọ bụ bọtịnụ.
<button type="button" class="btn btn-primary position-relative">
Inbox
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
99+
<span class="visually-hidden">unread messages</span>
</span>
</button>
Ị nwekwara ike dochie .badge
klas ahụ na ole na ole ọzọ utilities na-enweghị a agụta maka ọzọ generic egosi.
<button type="button" class="btn btn-primary position-relative">
Profile
<span class="position-absolute top-0 start-100 translate-middle p-2 bg-danger border border-light rounded-circle">
<span class="visually-hidden">New alerts</span>
</span>
</button>
Agba agba
Agbakwunyere na v5.2.0Tọọ ụzọ background-color
dị iche color
na ndị enyemaka anyị.text-bg-{color}
. Na mbụ, achọrọ iji aka gị jikọta nhọrọ gị .text-{color}
yana .bg-{color}
akụrụngwa maka ịke, nke ị ka nwere ike iji ma ọ bụrụ na ịchọrọ.
<span class="badge text-bg-primary">Primary</span>
<span class="badge text-bg-secondary">Secondary</span>
<span class="badge text-bg-success">Success</span>
<span class="badge text-bg-danger">Danger</span>
<span class="badge text-bg-warning">Warning</span>
<span class="badge text-bg-info">Info</span>
<span class="badge text-bg-light">Light</span>
<span class="badge text-bg-dark">Dark</span>
Na-eme ka ọ pụta ìhè na teknụzụ enyemaka
Iji agba iji gbakwunye ihe ọ pụtara naanị na-enye ihe ngosi anya, nke a na-agaghị ebugara ndị ọrụ teknụzụ enyemaka - dị ka ndị na-agụ ihuenyo. Gbaa mbọ hụ na ozi nke agba gosipụtara pụtara ìhè site na ọdịnaya n'onwe ya (dịka ederede a na-ahụ anya), ma ọ bụ tinye ya site na ụzọ ọzọ, dị ka ederede agbakwunyere zoro ezo na .visually-hidden
klaasị.
baajị ọgwụ
Jiri .rounded-pill
klaasị ịba uru mee ka baajị bụrụ nke buru ibu karịa border-radius
.
<span class="badge rounded-pill text-bg-primary">Primary</span>
<span class="badge rounded-pill text-bg-secondary">Secondary</span>
<span class="badge rounded-pill text-bg-success">Success</span>
<span class="badge rounded-pill text-bg-danger">Danger</span>
<span class="badge rounded-pill text-bg-warning">Warning</span>
<span class="badge rounded-pill text-bg-info">Info</span>
<span class="badge rounded-pill text-bg-light">Light</span>
<span class="badge rounded-pill text-bg-dark">Dark</span>
CSS
Mgbanwe
Agbakwunyere na v5.2.0Dịka akụkụ nke mgbanwe mgbanwe CSS nke Bootstrap, baajị na-ejizi mgbanwe CSS mpaghara .badge
maka imeziwanye ezigbo oge. A na-edozi ụkpụrụ maka mgbanwe CSS site na Sass, yabụ ka na-akwado nhazi Sass, kwa.
--#{$prefix}badge-padding-x: #{$badge-padding-x};
--#{$prefix}badge-padding-y: #{$badge-padding-y};
@include rfs($badge-font-size, --#{$prefix}badge-font-size);
--#{$prefix}badge-font-weight: #{$badge-font-weight};
--#{$prefix}badge-color: #{$badge-color};
--#{$prefix}badge-border-radius: #{$badge-border-radius};
Sass variables
$badge-font-size: .75em;
$badge-font-weight: $font-weight-bold;
$badge-color: $white;
$badge-padding-y: .35em;
$badge-padding-x: .65em;
$badge-border-radius: $border-radius;