Nri achịcha
Gosipụta ọnọdụ ibe dị ugbu a n'ime usoro ịnyagharị na-agbakwunye ndị nkewa na-akpaghị aka site na CSS.
Ọmụmaatụ
Jiri ndepụta enyere iwu ma ọ bụ enweghị usoro nwere ihe ndetu ejikọtara iji mepụta obere achịcha edoziri obere. Jiri ngwa anyị ịgbakwunye ụdị ndị ọzọ dịka achọrọ.
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Home</li>
</ol>
</nav>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>
</nav>
Ndị nkesa
A na-agbakwunye ndị nkesa na-akpaghị aka na CSS site ::before
na content
. Enwere ike ịgbanwe ha site na ịmegharị ihe onwunwe omenala CSS mpaghara --bs-breadcrumb-divider
, ma ọ bụ site na $breadcrumb-divider
mgbanwe Sass - yana $breadcrumb-divider-flipped
maka ndị otu RTL ya, ọ bụrụ na ọ dị mkpa. Anyị na-adaba na mgbanwe Sass anyị, nke edobere ka ọdịda na akụrụngwa omenala. N'ụzọ dị otú a, ị ga-enweta nkesa zuru ụwa ọnụ nke ị nwere ike ịkagbu na-enweghị achịkọta CSS n'oge ọ bụla.
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
Mgbe ị na-agbanwe site na Sass, a na -achọ ọrụ ntinye akwụkwọ iji mepụta nhota ndị dị n'akụkụ eriri. Dịka ọmụmaatụ, iji >
dị ka nkesa, ịnwere ike iji nke a:
$breadcrumb-divider: quote(">");
Ọ dịkwa ike iji akara ngosi SVG agbakwunyere . Tinye ya site na akụrụngwa omenala CSS anyị, ma ọ bụ jiri mgbanwe Sass.
<nav style="--bs-breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='currentColor'/%3E%3C/svg%3E");" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
$breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='currentColor'/%3E%3C/svg%3E");
Ị nwekwara ike wepụ ntọala nkesa --bs-breadcrumb-divider: '';
(ụdọ efu na CSS omenala Properties na-agụ dị ka uru), ma ọ bụ ịtọ Sass variable ka $breadcrumb-divider: none;
.
<nav style="--bs-breadcrumb-divider: '';" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
$breadcrumb-divider: none;
Nnweta
Ebe ọ bụ na achịcha achịcha na-enye igodo, ọ dị mma ịgbakwunye akara nwere uru dị ka aria-label="breadcrumb"
ịkọwapụta ụdị igodo enyere na <nav>
mmewere, yana itinye ihe aria-current="page"
n'ihe ikpeazụ nke setịpụrụ iji gosi na ọ na-anọchi anya ibe dị ugbu a.
Maka ozi ndị ọzọ, hụ Omume edemede WAI-ARIA maka ụkpụrụ achịcha achịcha .
Sass
Mgbanwe
$breadcrumb-font-size: null;
$breadcrumb-padding-y: 0;
$breadcrumb-padding-x: 0;
$breadcrumb-item-padding-x: .5rem;
$breadcrumb-margin-bottom: 1rem;
$breadcrumb-bg: null;
$breadcrumb-divider-color: $gray-600;
$breadcrumb-active-color: $gray-600;
$breadcrumb-divider: quote("/");
$breadcrumb-divider-flipped: $breadcrumb-divider;
$breadcrumb-border-radius: null;