Imvuthuluka yesinkwa
Bonisa indawo yekhasi lamanje phakathi kwesigaba sokuhamba esingeza izihlukanisi ngokuzenzakalelayo nge-CSS.
Isibonelo
Sebenzisa uhlu olu-odwe noma olunga-odwe olunezinto zohlu oluxhumene ukuze udale imvuthuluka yesinkwa enesitayela esincane. Sebenzisa izinsiza zethu ukwengeza izitayela ezengeziwe njengoba uthanda.
<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>
Abahlukanisi
Izihlukanisi zengezwa ngokuzenzakalelayo ku-CSS nge- ::before
. content
Angashintshwa ngokushintsha indawo yangokwezifiso ye-CSS --bs-breadcrumb-divider
, noma ngokuhlukahluka kwe- $breadcrumb-divider
Sass — kanye $breadcrumb-divider-flipped
nozakwabo we-RTL, uma kudingeka. Sizenzakalela kokuguquguquka kwethu kwe-Sass, okusethwe njengokubuyela emuva endaweni yangokwezifiso. Ngale ndlela, uthola isihlukanisi somhlaba wonke ongakwazi ukusibhala ngaphandle kokubuyisela i-CSS noma kunini.
<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>
Uma ulungisa nge-Sass, umsebenzi wokucaphuna uyadingeka ukuze ukhiqize izingcaphuno eduze kweyunithi yezinhlamvu. Isibonelo, usebenzisa >
njengesihlukanisi, ungasebenzisa lokhu:
$breadcrumb-divider: quote(">");
Kuyenzeka futhi usebenzise isithonjana esishumekiwe se-SVG . Sisebenzise ngempahla yethu yangokwezifiso ye-CSS, noma sebenzisa okuguquguqukayo kwe-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");
Ungakwazi futhi ukususa ukulungiselelwa kwesihlukanisi --bs-breadcrumb-divider: '';
(amayunithi ezinhlamvu angenalutho ezicini zangokwezifiso ze-CSS abalwa njengevelu), noma ukusetha okuguquguqukayo kwe-Sass ku- $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;
Ukufinyeleleka
Njengoba i-breadcrumbs ihlinzeka ngokuzulazula, kuwumqondo omuhle ukwengeza ilebula enengqondo njengokuchaza aria-label="breadcrumb"
uhlobo lokuzulazula olunikezwe <nav>
kusici, kanye nokusebenzisa aria-current="page"
okuthi entweni yokugcina yesethi ukukhombisa ukuthi imele ikhasi lamanje.
Ukuze uthole ulwazi olwengeziwe, bona Imikhuba Yokugunyaza ye-WAI-ARIA yephethini ye-breadcrumb .
Sass
Okuguquguqukayo
$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;