Daim npav
Bootstrap's phaib muab cov ntsiab lus hloov tau yooj yim thiab txuas ntxiv nrog ntau yam sib txawv thiab kev xaiv.
Txog
Ib daim npav yog ib lub thawv ntim tau yooj yim thiab nthuav dav. Nws suav nrog cov kev xaiv rau headers thiab footers, ntau yam ntawm cov ntsiab lus, cov ntsiab lus tom qab xim, thiab cov kev xaiv muaj zog. Yog tias koj paub txog Bootstrap 3, phaib hloov peb cov vaj huam sib luag qub, qhov dej, thiab cov duab me me. Kev ua haujlwm zoo sib xws rau cov khoom siv no muaj xws li cov chav kawm hloov kho rau daim npav.
Piv txwv
Daim npav tau tsim nrog me me cim thiab cov qauv raws li qhov ua tau, tab sis tseem tswj kom xa ib tuj ntawm kev tswj thiab kev hloov kho. Ua nrog flexbox, lawv muab kev sib dhos yooj yim thiab sib xyaw zoo nrog lwm cov khoom siv Bootstrap. Lawv tsis muaj margin
los ntawm lub neej ntawd, yog li siv cov khoom siv sib nrug raws li xav tau.
Hauv qab no yog ib qho piv txwv ntawm daim npav yooj yim nrog cov ntsiab lus sib xyaw thiab qhov dav ruaj khov. Daim npav tsis muaj qhov dav ruaj khov pib, yog li lawv yuav ib txwm sau tag nrho qhov dav ntawm nws niam txiv lub ntsiab. Qhov no tau yooj yim kho nrog peb ntau yam kev xaiv sizing .
Daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Mus qhov twg<div class="card" style="width: 18rem;">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Cov ntsiab lus hom
Daim npav txhawb ntau cov ntsiab lus, suav nrog cov duab, ntawv nyeem, npe pawg, txuas, thiab ntau dua. Hauv qab no yog cov piv txwv ntawm qhov kev txhawb nqa.
Lub cev
Lub tsev thaiv ntawm ib daim npav yog lub .card-body
. Siv nws thaum twg koj xav tau ib qho padded seem hauv daim npav.
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>
Lub npe, ntawv nyeem, thiab txuas
Daim npav lub npe yog siv los ntawm kev ntxiv .card-title
rau ib <h*>
daim ntawv. Nyob rau hauv tib txoj kev, txuas ntxiv thiab muab tso rau ib sab los ntawm kev ntxiv .card-link
rau ib <a>
daim ntawv.
Subtitles yog siv los ntawm kev ntxiv ib .card-subtitle
lub <h*>
cim npe. Yog hais tias cov khoom .card-title
thiab cov .card-subtitle
khoom raug muab tso rau hauv ib .card-body
yam khoom, daim npav lub npe thiab subtitle tau ua raws li zoo.
Daim npav npe
Daim npav subtitle
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Daim npav txuas Lwm qhov txuas<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="card-link">Card link</a>
<a href="#" class="card-link">Another link</a>
</div>
</div>
Duab
.card-img-top
tso ib daim duab rau saum daim npav. Nrog .card-text
, ntawv tuaj yeem ntxiv rau daim npav. Cov ntawv hauv .card-text
kuj tuaj yeem tsim nrog cov qauv HTML cim npe.
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
<div class="card" style="width: 18rem;">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
Sau pawg
Tsim cov npe ntawm cov ntsiab lus nyob rau hauv ib daim npav nrog cov pab pawg flush.
- Ib yam khoom
- Ib yam khoom thib ob
- Ib yam khoom thib peb
<div class="card" style="width: 18rem;">
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
</div>
- Ib yam khoom
- Ib yam khoom thib ob
- Ib yam khoom thib peb
<div class="card" style="width: 18rem;">
<div class="card-header">
Featured
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
</div>
- Ib yam khoom
- Ib yam khoom thib ob
- Ib yam khoom thib peb
<div class="card" style="width: 18rem;">
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<div class="card-footer">
Card footer
</div>
</div>
Chav dej dab dej
Sib tov thiab phim ntau hom ntsiab lus los tsim daim npav koj xav tau, lossis pov txhua yam hauv qhov ntawd. Qhia hauv qab no yog cov qauv duab, thaiv, cov ntawv sau, thiab ib pawg npe-tag nrho qhwv hauv daim npav qhov dav.
Daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
- Ib yam khoom
- Ib yam khoom thib ob
- Ib yam khoom thib peb
<div class="card" style="width: 18rem;">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<div class="card-body">
<a href="#" class="card-link">Card link</a>
<a href="#" class="card-link">Another link</a>
</div>
</div>
Header thiab footer
Ntxiv ib qho kev xaiv header thiab / lossis footer hauv daim npav.
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card">
<div class="card-header">
Featured
</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Daim npav headers tuaj yeem tsim tau los ntawm kev ntxiv .card-header
rau <h*>
cov ntsiab lus.
Featured
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card">
<h5 class="card-header">Featured</h5>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Ib qho zoo-paub quotes, muaj nyob rau hauv ib lub ntsiab lus blockquote.
<div class="card">
<div class="card-header">
Quote
</div>
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>A well-known quote, contained in a blockquote element.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
</div>
</div>
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card text-center">
<div class="card-header">
Featured
</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
<div class="card-footer text-muted">
2 days ago
</div>
</div>
Qhov loj me
Daim npav xav tias tsis muaj qhov tshwj xeeb width
los pib, yog li lawv yuav yog 100% dav tshwj tsis yog hais tias lwm yam. Koj tuaj yeem hloov qhov no raws li xav tau nrog kev cai CSS, chav kawm kab sib chaws, kab sib chaws Sass mixins, lossis cov khoom siv hluav taws xob.
Siv daim phiaj markup
Siv daim phiaj, qhwv daim npav hauv kab thiab kab raws li xav tau.
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twgKev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
Kev siv hluav taws xob
Siv peb txhais tes ntawm cov khoom siv uas muaj qhov loj me los teeb tsa daim npav qhov dav sai.
Daim npav npe
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
KhawmDaim npav npe
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Khawm<div class="card w-75">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
<div class="card w-50">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
Siv kev cai CSS
Siv kev cai CSS hauv koj daim ntawv teev cov style lossis ua inline styles los teeb qhov dav.
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Cov ntawv nyeem alignment
Koj tuaj yeem hloov pauv cov ntawv nyeem ntawm txhua daim npav-hauv tag nrho lossis ib qho tshwj xeeb-nrog rau peb cov ntawv nyeem cov chav kawm .
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twgKev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twgKev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card text-center" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card text-end" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Kev taw qhia
Ntxiv qee qhov kev taw qhia rau daim npav header (lossis thaiv) nrog Bootstrap's nav Cheebtsam .
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card text-center">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="true" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Kev kho lub npe tshwj xeeb
Nrog kev txhawb nqa cov ntawv hauv qab no raws li lub ntuj tsim ua rau cov ntsiab lus ntxiv.
Mus qhov twg<div class="card text-center">
<div class="card-header">
<ul class="nav nav-pills card-header-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
Duab
Daim npav suav nrog ob peb txoj kev xaiv rau kev ua haujlwm nrog cov duab. Xaiv los ntawm qhov txuas ntxiv "cov duab caps" nyob rau ntawm qhov kawg ntawm daim npav, muab cov duab sib tshooj nrog cov ntsiab lus ntawm daim npav, lossis tsuas yog muab cov duab tso rau hauv daim npav.
Duab caps
Zoo ib yam li headers thiab footers, phaib tuaj yeem suav nrog sab saum toj thiab hauv qab "cov duab caps" - cov duab saum lossis hauv qab ntawm daim npav.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Hloov tshiab kawg 3 mins dhau los
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Hloov tshiab kawg 3 mins dhau los
<div class="card mb-3">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
<img src="..." class="card-img-bottom" alt="...">
</div>
Duab overlays
Tig ib daim duab rau hauv daim npav keeb kwm yav dhau thiab hla koj daim npav cov ntawv. Nyob ntawm daim duab, koj tuaj yeem lossis tsis xav tau cov qauv lossis cov khoom siv ntxiv.
<div class="card text-bg-dark">
<img src="..." class="card-img" alt="...">
<div class="card-img-overlay">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small>Last updated 3 mins ago</small></p>
</div>
</div>
Kab rov tav
Siv kev sib xyaw ua ke ntawm kab sib chaws thiab cov chav kawm siv hluav taws xob, daim npav tuaj yeem ua kab rov tav hauv txoj hauv kev txawb thiab teb. Hauv qhov piv txwv hauv qab no, peb tshem tawm cov kab sib txuas nrog .g-0
thiab siv .col-md-*
cov chav kawm los ua daim npav kab rov tav ntawm qhov md
tawg. Kev hloov kho ntxiv yuav xav tau nyob ntawm koj daim npav cov ntsiab lus.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Hloov tshiab kawg 3 mins dhau los
<div class="card mb-3" style="max-width: 540px;">
<div class="row g-0">
<div class="col-md-4">
<img src="..." class="img-fluid rounded-start" alt="...">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
Daim npav hom
Daim npav muaj ntau yam kev xaiv rau customizing lawv keeb kwm yav dhau, ciam teb, thiab xim.
Tom qab thiab xim
Ntxiv hauv v5.2.0Teem ib background-color
qhov sib piv rau pem hauv ntej color
nrog peb cov .text-bg-{color}
neeg pab . Yav dhau los nws yuav tsum tau manually khub koj xaiv .text-{color}
thiab .bg-{color}
cov khoom siv rau styling, uas koj tseem siv tau yog tias koj nyiam.
Thawj daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Thib ob daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Success card npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Danger card npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Warning card title
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Cov ntaub ntawv daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Lub teeb daim ntawv npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Tsaus daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
<div class="card text-bg-primary mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Primary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-secondary mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Secondary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-success mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Danger card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Warning card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-info mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Info card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-light mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Light card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card text-bg-dark mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Dark card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</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 .visually-hidden
chav kawm.
Ciam teb
Siv cov khoom siv ciam teb hloov pauv border-color
ntawm daim npav xwb. Nco ntsoov tias koj tuaj yeem muab .text-{color}
cov chav kawm tso rau ntawm niam txiv .card
lossis ib feem ntawm daim npav cov ntsiab lus raws li qhia hauv qab no.
Thawj daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Thib ob daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Success card npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Danger card npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Warning card title
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Cov ntaub ntawv daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Lub teeb daim ntawv npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
Tsaus daim npav npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
<div class="card border-primary mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body text-primary">
<h5 class="card-title">Primary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-secondary mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body text-secondary">
<h5 class="card-title">Secondary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-success mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body text-success">
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-danger mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body text-danger">
<h5 class="card-title">Danger card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-warning mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Warning card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-info mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Info card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-light mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Light card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="card border-dark mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body text-dark">
<h5 class="card-title">Dark card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
Mixins cov kev pab cuam
Koj tuaj yeem hloov cov ciam teb ntawm daim npav header thiab footer raws li xav tau, thiab txawm tias tshem lawv background-color
nrog .bg-transparent
.
Success card npe
Qee cov ntawv piv txwv ceev los tsim cov npe ntawm daim npav thiab ua kom muaj ntau ntawm daim npav cov ntsiab lus.
<div class="card border-success mb-3" style="max-width: 18rem;">
<div class="card-header bg-transparent border-success">Header</div>
<div class="card-body text-success">
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<div class="card-footer bg-transparent border-success">Footer</div>
</div>
Daim npav layout
Ntxiv nrog rau styling cov ntsiab lus nyob rau hauv phaib, Bootstrap suav nrog ob peb txoj kev xaiv rau nteg tawm series ntawm phaib. Txog lub sijhawm tam sim no, cov kev xaiv layout no tseem tsis tau teb .
Daim npav pab pawg
Siv cov pab pawg los muab daim npav ua ib qho, txuas nrog cov kab sib npaug thiab qhov siab. Daim npav pab pawg pib tawm pawg thiab siv display: flex;
los txuas nrog qhov sib txawv ntawm qhov pib ntawm qhov sm
tawg.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Hloov tshiab kawg 3 mins dhau los
Daim npav npe
Daim npav no muaj kev txhawb nqa cov ntawv hauv qab no raws li kev coj mus rau hauv cov ntsiab lus ntxiv.
Hloov tshiab kawg 3 mins dhau los
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Daim npav no muaj cov ntsiab lus ntev dua li thawj zaug los qhia tias qhov siab sib npaug.
Hloov tshiab kawg 3 mins dhau los
<div class="card-group">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
Thaum siv cov pab pawg nrog cov footers, lawv cov ntsiab lus yuav cia li kab.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Daim npav no muaj kev txhawb nqa cov ntawv hauv qab no raws li kev coj mus rau hauv cov ntsiab lus ntxiv.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Daim npav no muaj cov ntsiab lus ntev dua li thawj zaug los qhia tias qhov siab sib npaug.
<div class="card-group">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
</div>
Daim npav
Siv Bootstrap grid system thiab nws cov .row-cols
chav kawm los tswj pes tsawg kab kab sib chaws (pob ib ncig ntawm koj daim npav) koj qhia ib kab. Piv txwv li, ntawm no yog .row-cols-1
nteg tawm cov ntawv teev lus ntawm ib kem, thiab .row-cols-md-2
faib plaub daim npav kom sib npaug dav thoob ntau kab, los ntawm qhov nruab nrab breakpoint.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
<div class="row row-cols-1 row-cols-md-2 g-4">
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
</div>
Hloov nws mus .row-cols-3
thiab koj yuav pom daim npav plaub qhwv.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
<div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
</div>
Thaum koj xav tau qhov siab sib npaug, ntxiv .h-100
rau daim npav. Yog tias koj xav tau qhov siab sib npaug los ntawm lub neej ntawd, koj tuaj yeem teeb tsa $card-height: 100%
hauv Sass.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Qhov no yog daim npav luv luv.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv.
Daim npav npe
Qhov no yog daim npav ntev dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
<div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a short card.</p>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
</div>
</div>
</div>
Ib yam li nrog cov pab pawg hauv daim npav, daim npav footers yuav cia li kab.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Cov ntsiab lus no ntev me ntsis.
Daim npav npe
Daim npav no muaj kev txhawb nqa cov ntawv hauv qab no raws li kev coj mus rau hauv cov ntsiab lus ntxiv.
Daim npav npe
Qhov no yog daim npav dav dua nrog cov ntawv txhawb nqa hauv qab no raws li kev coj mus rau cov ntsiab lus ntxiv. Daim npav no muaj cov ntsiab lus ntev dua li thawj zaug los qhia tias qhov siab sib npaug.
<div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
</div>
</div>
Masonry
Hauv v4
peb siv CSS-tsuas cov txheej txheem los ua tus cwj pwm ntawm Masonry -zoo li kab, tab sis cov txheej txheem no tuaj nrog ntau yam kev mob tshwm sim tsis zoo . Yog tias koj xav kom muaj hom kev teeb tsa no v5
, koj tuaj yeem siv Masonry plugin. Masonry tsis suav nrog hauv Bootstrap , tab sis peb tau ua piv txwv ua piv txwv los pab koj pib.
CSS
Hloov pauv
Ntxiv hauv v5.2.0Raws li ib feem ntawm Bootstrap qhov kev hloov pauv CSS hloov pauv mus kom ze, daim npav tam sim no siv cov CSS hauv zos .card
rau kev hloov kho lub sijhawm tiag tiag. Cov txiaj ntsig rau CSS qhov sib txawv tau teeb tsa ntawm Sass, yog li Sass customization tseem txhawb nqa, ib yam nkaus.
--#{$prefix}card-spacer-y: #{$card-spacer-y};
--#{$prefix}card-spacer-x: #{$card-spacer-x};
--#{$prefix}card-title-spacer-y: #{$card-title-spacer-y};
--#{$prefix}card-border-width: #{$card-border-width};
--#{$prefix}card-border-color: #{$card-border-color};
--#{$prefix}card-border-radius: #{$card-border-radius};
--#{$prefix}card-box-shadow: #{$card-box-shadow};
--#{$prefix}card-inner-border-radius: #{$card-inner-border-radius};
--#{$prefix}card-cap-padding-y: #{$card-cap-padding-y};
--#{$prefix}card-cap-padding-x: #{$card-cap-padding-x};
--#{$prefix}card-cap-bg: #{$card-cap-bg};
--#{$prefix}card-cap-color: #{$card-cap-color};
--#{$prefix}card-height: #{$card-height};
--#{$prefix}card-color: #{$card-color};
--#{$prefix}card-bg: #{$card-bg};
--#{$prefix}card-img-overlay-padding: #{$card-img-overlay-padding};
--#{$prefix}card-group-margin: #{$card-group-margin};
Sass variables
$card-spacer-y: $spacer;
$card-spacer-x: $spacer;
$card-title-spacer-y: $spacer * .5;
$card-border-width: $border-width;
$card-border-color: var(--#{$prefix}border-color-translucent);
$card-border-radius: $border-radius;
$card-box-shadow: null;
$card-inner-border-radius: subtract($card-border-radius, $card-border-width);
$card-cap-padding-y: $card-spacer-y * .5;
$card-cap-padding-x: $card-spacer-x;
$card-cap-bg: rgba($black, .03);
$card-cap-color: null;
$card-height: null;
$card-color: null;
$card-bg: $white;
$card-img-overlay-padding: $spacer;
$card-group-margin: $grid-gutter-width * .5;