Sau npe pawg
Cov npe pawg yog qhov hloov pauv tau thiab muaj zog rau kev nthuav tawm cov ntsiab lus. Hloov kho thiab txuas rau lawv kom txhawb nqa tsuas yog hais txog cov ntsiab lus hauv.
Cov pab pawg sau npe yooj yim tshaj plaws yog cov npe tsis muaj npe nrog cov npe khoom thiab cov chav kawm tsim nyog. Ua rau nws nrog cov kev xaiv ua raws, lossis nrog koj tus kheej CSS raws li xav tau.
- Cras justo odio
- Dapibus ac facilisis nyob rau hauv
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum thiab eros
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Ntxiv .active
rau qhov .list-group-item
qhia txog kev xaiv tam sim no.
- Cras justo odio
- Dapibus ac facilisis nyob rau hauv
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum thiab eros
<ul class="list-group">
<li class="list-group-item active">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Ntxiv .disabled
rau qhov .list-group-item
ua rau nws tshwm tsis taus. Nco ntsoov tias qee cov ntsiab lus nrog .disabled
kuj yuav xav tau kev cai JavaScript kom ua tiav lawv cov xwm txheej nyem (piv txwv li, txuas).
- Cras justo odio
- Dapibus ac facilisis nyob rau hauv
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum thiab eros
<ul class="list-group">
<li class="list-group-item disabled">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Siv <a>
s los yog <button>
s los tsim cov npe ua haujlwm pab pawg nrog hover, disabled, thiab active xeev los ntawm kev ntxiv .list-group-item-action
. Peb cais cov pseudo-chav kawm no kom paub meej cov npe pawg ua los ntawm cov ntsiab lus tsis sib cuam tshuam (xws li <li>
s lossis <div>
s) tsis muab kev nias lossis kais them nyiaj.
Nco ntsoov tsis txhob siv cov .btn
chav kawm txheem ntawm no .
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active">
Cras justo odio
</a>
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
<a href="#" class="list-group-item list-group-item-action">Morbi leo risus</a>
<a href="#" class="list-group-item list-group-item-action">Porta ac consectetur ac</a>
<a href="#" class="list-group-item list-group-item-action disabled">Vestibulum at eros</a>
</div>
Nrog <button>
s, koj tuaj yeem siv tus disabled
cwj pwm hloov ntawm .disabled
chav kawm. Tu siab, <a>
s tsis txhawb tus cwj pwm tsis taus.
<div class="list-group">
<button type="button" class="list-group-item list-group-item-action active">
Cras justo odio
</button>
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
<button type="button" class="list-group-item list-group-item-action" disabled>Vestibulum at eros</button>
</div>
Ntxiv .list-group-flush
kom tshem tawm qee qhov ciam teb thiab cov ces kaum sib npaug los ua cov npe pawg cov khoom ntug-rau-ntug hauv lub thawv niam txiv (piv txwv li, phaib).
- Cras justo odio
- Dapibus ac facilisis nyob rau hauv
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum thiab eros
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Siv cov chav kawm hauv cov ntsiab lus los tsim cov npe khoom nrog cov keeb kwm yav dhau los thiab xim.
- Dapibus ac facilisis nyob rau hauv
- Qhov no yog thawj pab pawg cov khoom
- Qhov no yog ib tug thib ob daim ntawv teev cov khoom
- Qhov no yog ib pab pawg ua tiav cov khoom
- Qhov no yog ib pab pawg neeg yam khoom txaus ntshai
- Nov yog ib pab pawg ceeb toom cov khoom
- Nov yog cov ntaub ntawv teev npe pab pawg yam khoom
- Qhov no yog ib pab pawg neeg lub teeb
- Qhov no yog ib pab pawg neeg yam khoom tsaus nti
<ul class="list-group">
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item list-group-item-primary">This is a primary list group item</li>
<li class="list-group-item list-group-item-secondary">This is a secondary list group item</li>
<li class="list-group-item list-group-item-success">This is a success list group item</li>
<li class="list-group-item list-group-item-danger">This is a danger list group item</li>
<li class="list-group-item list-group-item-warning">This is a warning list group item</li>
<li class="list-group-item list-group-item-info">This is a info list group item</li>
<li class="list-group-item list-group-item-light">This is a light list group item</li>
<li class="list-group-item list-group-item-dark">This is a dark list group item</li>
</ul>
Cov chav kawm ntawv ntsiab lus kuj ua haujlwm nrog .list-group-item-action
. Nco ntsoov qhov sib ntxiv ntawm cov hover styles ntawm no tsis muaj nyob rau hauv qhov piv txwv yav dhau los. Kuj txhawb yog lub .active
xeev; siv nws los qhia txog qhov kev xaiv ua haujlwm ntawm cov npe ntawm cov ntsiab lus ntawm pawg khoom.
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-primary">This is a primary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-secondary">This is a secondary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-success">This is a success list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-danger">This is a danger list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">This is a warning list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-info">This is a info list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-light">This is a light list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-dark">This is a dark list group item</a>
</div>
Qhia lub ntsiab lus rau kev pab technologies
Siv cov xim los ntxiv cov ntsiab lus tsuas yog muab qhov pom kev pom, uas yuav tsis raug xa mus rau cov neeg siv cov thev naus laus zis pab - xws li cov ntawv nyeem. Xyuas kom meej tias cov ntaub ntawv qhia los ntawm cov xim yog pom tseeb los ntawm cov ntsiab lus nws tus kheej (xws li cov ntawv pom), lossis suav nrog lwm txoj kev, xws li cov ntawv ntxiv zais nrog cov .sr-only
chav kawm.
Ntxiv cov paib rau ib pawg ntawm cov npe khoom kom pom cov lej tsis tau nyeem, kev ua ub no, thiab ntau ntxiv nrog kev pab los ntawm qee cov khoom siv hluav taws xob .
- Cras justo odio14
- Dapibus ac facilisis nyob rau hauv2
- Morbi leo risus1
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Cras justo odio
<span class="badge badge-primary badge-pill">14</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Dapibus ac facilisis in
<span class="badge badge-primary badge-pill">2</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Morbi leo risus
<span class="badge badge-primary badge-pill">1</span>
</li>
</ul>
Ntxiv ze li ntawm HTML nyob rau hauv, txawm rau cov pab pawg sib txuas xws li ib qho hauv qab no, nrog kev pab ntawm flexbox utilities .
Sau npe pab pawg kab lus
3 hnub dhau losDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Sau npe pab pawg kab lus
3 hnub dhau losDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Sau npe pab pawg kab lus
3 hnub dhau losDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.<div class="list-group">
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start active">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small>3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small>Donec id elit non mi porta.</small>
</a>
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small class="text-muted">Donec id elit non mi porta.</small>
</a>
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small class="text-muted">Donec id elit non mi porta.</small>
</a>
</div>
Siv lub tab JavaScript plugin - suav nrog nws tus kheej lossis los ntawm cov ntaub ntawv sau ua ke bootstrap.js
- txhawm rau txuas peb cov npe pawg los tsim cov tabbable panes ntawm cov ntsiab lus hauv zos.
Koj tuaj yeem qhib cov npe pab pawg navigation yam tsis tau sau ib qho JavaScript los ntawm kev qhia yooj yim data-toggle="list"
lossis ntawm lub ntsiab lus. Siv cov ntaub ntawv tus cwj pwm ntawm .list-group-item
.
Pab kom tabbable cov npe khoom ntawm JavaScript (txhua daim ntawv teev npe yuav tsum tau qhib ib tus zuj zus):
Koj tuaj yeem qhib cov npe ntawm tus kheej hauv ntau txoj hauv kev:
Txhawm rau ua kom lub vaj huam sib luag ploj mus, ntxiv .fade
rau txhua qhov .tab-pane
. Thawj tab pane yuav tsum tau .show
ua kom pom cov ntsiab lus thawj zaug.
Activates ib daim ntawv teev cov ntsiab lus thiab cov ntsiab lus ntim. Tab yuav tsum muaj ib data-target
lossis ib lub href
hom phiaj rau lub thawv ntim hauv DOM.
Xaiv cov npe uas tau muab thiab qhia nws cov kab sib txuas. Lwm cov npe uas tau xaiv yav dhau los yuav tsis raug xaiv thiab nws cov pane cuam tshuam tau muab zais. Rov qab mus rau tus neeg hu ua ntej lub tab pane tau tshwm sim tiag tiag (piv txwv li, ua ntej qhov shown.bs.tab
xwm txheej tshwm sim).
Thaum pom ib lub tab tshiab, cov xwm txheej hluav taws kub hauv qhov kev txiav txim hauv qab no:
hide.bs.tab
(ntawm lub tab active tam sim no)show.bs.tab
(ntawm qhov yuav tsum tau qhia tab)hidden.bs.tab
(nyob rau yav dhau los active tab, tib yam li rau qhovhide.bs.tab
kev tshwm sim)shown.bs.tab
(ntawm lub tab tshiab uas nyuam qhuav tshwm sim, tib yam li rau qhovshow.bs.tab
kev tshwm sim)
Yog tias tsis muaj tab twb ua haujlwm, hide.bs.tab
thiab hidden.bs.tab
cov xwm txheej yuav tsis raug rho tawm haujlwm.
Hom xwm txheej | Kev piav qhia |
---|---|
show.bs.tab | Qhov kev tshwm sim no tua hluav taws ntawm tab qhia, tab sis ua ntej tab tshiab tau tshwm sim. Siv event.target thiab event.relatedTarget tsom rau lub tab active thiab yav dhau los active tab (yog tias muaj) feem. |
ua.bs.tab | Qhov kev tshwm sim no tua hluav taws ntawm tab qhia tom qab tau pom tab. Siv event.target thiab event.relatedTarget tsom rau lub tab active thiab yav dhau los active tab (yog tias muaj) feem. |
hide.bs.tab | Qhov kev tshwm sim no tua hluav taws thaum lub tab tshiab yuav tsum tau tshwm sim (thiab yog li lub tab yav dhau los yuav tsum tau muab zais). Siv event.target thiab event.relatedTarget tsom rau cov tab tam sim no thiab cov tshiab sai sai-rau-yuav-ua haujlwm tab, feem. |
hidden.bs.tab | Qhov kev tshwm sim no tshwm sim tom qab lub tab tshiab tau tshwm sim (thiab yog li lub tab active yav dhau los tau muab zais). Siv event.target thiab event.relatedTarget tsom mus rau lub tab active yav dhau los thiab cov tshiab tab tshiab, raws li. |