Bohobe
Hlahisa sebaka sa leqephe la hajoale ka har'a sehlopha sa maemo a marang-rang se eketsang likarohano ka CSS.
Mohlala
Sebelisa lethathamo le laetsoeng kapa le sa reroang le nang le lethathamo la lintho tse hokahaneng ho theha breadcrumb e entsoeng ka mokhoa o fokolang. Sebelisa lisebelisoa tsa rona ho eketsa mekhoa e meng kamoo u batlang.
<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>
Ba arolang
Li-Dividers li kenyelletsoa ka bo eona ho CSS ka ::before
le content
. Li ka fetoloa ka ho fetola thepa ea CSS ea lehae --bs-breadcrumb-divider
, kapa ka ho $breadcrumb-divider
feto-fetoha ha Sass - le $breadcrumb-divider-flipped
bakeng sa molekane oa eona oa RTL, ha ho hlokahala. Re ikhethela ho feto-fetoha ha Sass ea rona, e behiloeng joalo ka mokhoa oa ho khutlela thepa ea moetlo. Ka tsela ena, o fumana karohano ea lefats'e eo u ka e fetisang ntle le ho khutlisa CSS ka nako efe kapa efe.
<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>
Ha u fetola ka Sass, mosebetsi oa qotsa oa hlokahala ho hlahisa mantsoe a qotsitsoeng ho potoloha khoele. Ka mohlala, ho sebelisa >
e le divider, u ka sebelisa sena:
$breadcrumb-divider: quote(">");
Hape hoa khoneha ho sebelisa lets'oao le kentsoeng la SVG . E sebelise ka thepa ea rona ea CSS, kapa sebelisa mofuta oa Sass.
Ho sebelisa SVG e kentsoeng
Ho kenya SVG joalo ka URI ea data ho hloka hore URL e balehe litlhaku tse 'maloa, haholo-holo <
, >
le #
. Ke ka lebaka leo $breadcrumb-divider
phapang e fetisetsoang escape-svg()
tšebetsong ea rona ea Sass . Ha o sebelisa thepa ea tloaelo ea CSS, o hloka ho URL e balehela SVG ea hau u le mong. Bala litlhaloso tsa Kevin Weber ho CodePen bakeng sa lintlha tse qaqileng mabapi le seo u lokelang ho se baleha.
<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='%236c757d'/%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,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8'><path d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='#{$breadcrumb-divider-color}'/></svg>");
U ka boela ua tlosa tlhophiso ea divider --bs-breadcrumb-divider: '';
(likhoele tse se nang letho ho thepa ea tloaelo ea CSS e baloa e le boleng), kapa ho beha phapang ea Sass ho $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;
Ho fihlella
Kaha li-breadcrumbs li fana ka mokhoa oa ho tsamaea, ke khopolo e ntle ho kenya letšoao le nang le moelelo joalo ka aria-label="breadcrumb"
ho hlalosa mofuta oa ho tsamaea o fanoeng karolong <nav>
, hammoho le ho sebelisa ntho aria-current="page"
ea ho qetela ea sete ho bontša hore e emela leqephe la hona joale.
Bakeng sa lintlha tse ling, bona mokhoa oa ARIA Authoring Practices Guide breadcrumb pattern .
CSS
Lintho tse fapaneng
E kentsoe ho v5.2.0Joalo ka karolo ea mokhoa oa ho fetoha oa CSS oa Bootstrap, li-breadcrumbs joale li sebelisa mefuta e fapaneng ea CSS ea lehae .breadcrumb
bakeng sa ntlafatso ea nako ea nnete. Litekanyetso tsa mefuta-futa ea CSS li behiloe ka Sass, kahoo mokhoa oa Sass o ntse o tšehetsoa, le oona.
--#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x};
--#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y};
--#{$prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom};
@include rfs($breadcrumb-font-size, --#{$prefix}breadcrumb-font-size);
--#{$prefix}breadcrumb-bg: #{$breadcrumb-bg};
--#{$prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius};
--#{$prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color};
--#{$prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x};
--#{$prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color};
Mefuta e fapaneng ea Sass
$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;