Akara akara
Tọkasi ipo oju-iwe lọwọlọwọ laarin awọn ilana lilọ kiri ti o ṣafikun awọn oluyapa laifọwọyi nipasẹ CSS.
Apeere
Lo atokọ ti a paṣẹ tabi ti a ko paṣẹ pẹlu awọn ohun atokọ ti o sopọ mọ lati ṣẹda jijẹ ounjẹ ti o kere ju. Lo awọn ohun elo wa lati ṣafikun awọn aza ni afikun bi o ṣe fẹ.
<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>
Awọn onipinpin
Awọn ipin ti wa ni afikun laifọwọyi ni CSS nipasẹ ::before
ati content
. Wọn le yipada nipasẹ iyipada ohun-ini aṣa CSS ti agbegbe --bs-breadcrumb-divider
, tabi nipasẹ $breadcrumb-divider
oniyipada Sass - ati $breadcrumb-divider-flipped
fun ẹlẹgbẹ RTL rẹ, ti o ba nilo. A ṣe aiyipada si oniyipada Sass wa, eyiti o ṣeto bi ipadasẹhin si ohun-ini aṣa. Ni ọna yii, o gba olupin agbaye ti o le fagile laisi atunko CSS nigbakugba.
<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>
Nigbati iyipada nipasẹ Sass, iṣẹ agbasọ naa nilo lati ṣe agbekalẹ awọn agbasọ ọrọ ni ayika okun kan. Fun apẹẹrẹ, ni lilo >
bi olupin, o le lo eyi:
$breadcrumb-divider: quote(">");
O tun ṣee ṣe lati lo aami SVG ti a fi sinu . Waye nipasẹ ohun-ini aṣa CSS wa, tabi lo oniyipada 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");
O tun le yọ eto olupin kuro --bs-breadcrumb-divider: '';
(awọn gbolohun ọrọ ti o ṣofo ni awọn ohun-ini aṣa CSS jẹ iye kan), tabi ṣeto oniyipada Sass si $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;
Wiwọle
Níwọ̀n bí búrẹ́dì ń pèsè ìṣíkiri kan, ó jẹ́ ìmọ̀ràn tí ó dára láti ṣàfikún aami kan tí ó nítumọ̀ gẹ́gẹ́ bí aria-label="breadcrumb"
láti ṣàpéjúwe irú ìṣàwárí tí a pèsè nínú <nav>
èròjà náà, àti fífi ohun kan aria-current="page"
sí ohun kan tí ó gbẹ̀yìn ti àgbékalẹ̀ láti fi hàn pé ó dúró fún ojú-ewé tí ń lọ lọ́wọ́.
Fun alaye diẹ ẹ sii, wo Awọn iṣe Aṣẹ alaṣẹ WAI-ARIA fun apẹrẹ akara akara .
Sass
Awọn oniyipada
$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;