Kertu
Kertu Bootstrap nyedhiyakake wadhah konten sing fleksibel lan bisa ditambah kanthi macem-macem varian lan pilihan.
Babagan
Kertu minangka wadhah isi sing fleksibel lan bisa diperluas. Iki kalebu opsi kanggo header lan footer, macem-macem konten, warna latar mburi kontekstual, lan opsi tampilan sing kuat. Yen sampeyan wis kenal karo Bootstrap 3, kertu ngganti panel, sumur, lan gambar cilik lawas. Fungsi sing padha karo komponen kasebut kasedhiya minangka kelas modifier kanggo kertu.
Tuladha
Kertu dibangun kanthi markup lan gaya sethithik, nanging isih bisa ngatur kontrol lan kustomisasi. Dibangun nganggo flexbox, nawakake keselarasan sing gampang lan nyampur karo komponen Bootstrap liyane. Dheweke ora duwe margin
standar, mula gunakake utilitas spasi yen perlu.
Ngisor iki conto kertu dhasar karo isi campuran lan jembaré tetep. Kertu ora duwe jembar sing tetep kanggo diwiwiti, mula kanthi alami bakal ngisi jembar lengkap unsur induke. Iki gampang disesuaikan karo macem-macem pilihan ukuran .
Judhul kertu
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Menyang ngendi wae<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>
Jinis isi
Kertu ndhukung macem-macem konten, kalebu gambar, teks, grup dhaptar, tautan, lan liya-liyane. Ing ngisor iki ana conto sing didhukung.
awak
Blok bangunan kertu yaiku .card-body
. Gunakake kapan sampeyan butuh bagean empuk ing kertu.
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>
Judhul, teks, lan pranala
Judhul kertu digunakake kanthi nambahake .card-title
tag <h*>
. Kanthi cara sing padha, pranala ditambahake lan diselehake ing jejere kanthi nambahake .card-link
tag <a>
.
Subtitle digunakake kanthi nambahake .card-subtitle
tag <h*>
. Yen .card-title
lan .card-subtitle
item diselehake ing .card-body
item, judhul kertu lan subtitle didadekake siji apik.
Judhul kertu
Subtitle kertu
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Link kertu Link liyane<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>
Gambar
.card-img-top
panggonan gambar ing ndhuwur kertu. Kanthi .card-text
, teks bisa ditambahake menyang kertu. Teks ing njero .card-text
uga bisa ditata nganggo tag HTML standar.
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
<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>
Dhaptar klompok
Gawe dhaptar isi ing kertu kanthi klompok dhaptar siram.
- Item
- Item kapindho
- Item katelu
<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>
- Item
- Item kapindho
- Item katelu
<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>
- Item
- Item kapindho
- Item katelu
<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>
Sink pawon
Nyampur lan cocog macem-macem jinis isi kanggo nggawe kertu sing perlu, utawa uncalan kabeh ing kono. Ditampilake ing ngisor iki yaiku gaya gambar, blok, gaya teks, lan klompok dhaptar - kabeh dibungkus kertu sing ambane tetep.
Judhul kertu
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
- Item
- Item kapindho
- Item katelu
<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 lan footer
Tambah header lan/utawa footer opsional ing kertu.
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Header kertu bisa ditata kanthi nambahake .card-header
unsur <h*>
.
Featured
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Kutipan kondhang, sing ana ing unsur 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>
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
ukuran
Kertu nganggep ora ana sing spesifik width
kanggo miwiti, mula bakal dadi 100% amba kajaba nyatakake. Sampeyan bisa ngganti iki yen perlu nganggo CSS khusus, kelas kothak, campuran Sass kothak, utawa utilitas.
Nggunakake grid markup
Nggunakake kothak, bungkus kertu ing kolom lan larik yen perlu.
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi waePerawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Nggunakake utilitas
Gunakake sawetara utilitas ukuran sing kasedhiya kanggo nyetel jembar kertu kanthi cepet.
Judhul kertu
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
TombolJudhul kertu
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Tombol<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>
Nggunakake CSS khusus
Gunakake CSS khusus ing stylesheets utawa minangka gaya inline kanggo nyetel ambane.
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
alignment teks
Sampeyan bisa kanthi cepet ngganti keselarasan teks kertu apa wae - kabeh utawa bagean tartamtu - kanthi kelas nyelarasake teks .
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi waePerawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi waePerawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Pandhu arah
Tambah sawetara pandhu arah menyang header kertu (utawa pamblokiran) karo komponen nav Bootstrap .
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Perawatan judhul khusus
Kanthi teks panyengkuyung ing ngisor iki minangka timbal alami kanggo konten tambahan.
Menyang ngendi wae<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>
Gambar
Kertu kalebu sawetara opsi kanggo nggarap gambar. Pilih saka nambahake "tutup gambar" ing salah siji mburi kertu, overlaying gambar karo isi kertu, utawa mung masang gambar ing kertu.
Gambar caps
Kaya header lan footer, kertu bisa ngemot "tutup gambar" ndhuwur lan ngisor - gambar ing ndhuwur utawa ngisor kertu.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Dianyari pungkasan 3 menit kepungkur
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Dianyari pungkasan 3 menit kepungkur
<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>
Gambar overlay
Ganti gambar dadi latar mburi kertu lan overlay teks kertu sampeyan. Gumantung ing gambar, sampeyan bisa uga ora mbutuhake gaya utawa keperluan tambahan.
<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>
Horisontal
Nggunakake kombinasi kelas kothak lan sarana, kertu bisa digawe horisontal kanthi cara sing ramah seluler lan responsif. Ing conto ing ngisor iki, kita mbusak talang kothak .g-0
lan nggunakake .col-md-*
kelas kanggo nggawe kertu horisontal ing md
breakpoint. Pangaturan liyane bisa uga dibutuhake gumantung isi kertu sampeyan.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Dianyari pungkasan 3 menit kepungkur
<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>
Gaya kertu
Kertu kalebu macem-macem opsi kanggo ngatur latar mburi, wates, lan werna.
Latar mburi lan werna
Ditambahake ing v5.2.0Setel background-color
latar ngarep sing kontras color
karo asisten kita.text-bg-{color}
. Sadurunge, sampeyan kudu masangake pilihan .text-{color}
lan .bg-{color}
keperluan kanggo gaya kanthi manual, sing isih bisa digunakake yen sampeyan seneng.
Judhul kertu utami
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu sekunder
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu sukses
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu bebaya
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu peringatan
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu info
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu cahya
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu peteng
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
<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>
Nuduhake makna kanggo teknologi assistive
Nggunakake warna kanggo nambah makna mung menehi indikasi visual, sing ora bakal dikirim menyang pangguna teknologi bantu - kayata pembaca layar. Priksa manawa informasi sing dituduhake kanthi warna katon jelas saka isi kasebut (umpamane teks sing katon), utawa kalebu liwat cara alternatif, kayata teks tambahan sing didhelikake karo .visually-hidden
kelas.
wates
Gunakake keperluan wates kanggo ngganti mung border-color
kertu. Elinga yen sampeyan bisa sijine .text-{color}
kelas ing wong tuwa .card
utawa subset saka isi kertu minangka kapacak ing ngisor iki.
Judhul kertu utami
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu sekunder
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu sukses
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu bebaya
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu peringatan
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu info
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu cahya
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
Judhul kertu peteng
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
<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>
Utilitas Mixins
Sampeyan uga bisa ngganti wates ing header kertu lan sikil yen perlu, lan malah mbusak background-color
karo .bg-transparent
.
Judhul kertu sukses
Sawetara teks conto cepet kanggo mbangun judhul kertu lan nggawe akeh isi kertu.
<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>
tata letak kertu
Saliyane nggawe konten ing kertu, Bootstrap kalebu sawetara opsi kanggo nggawe seri kertu. Saiki, opsi tata letak iki durung responsif .
Klompok kertu
Gunakake kelompok kertu kanggo nerjemahake kertu minangka siji, unsur ditempelake karo jembaré witjaksono lan dhuwur kolom. Klompok kertu diwiwiti kanthi ditumpuk lan digunakake display: flex;
kanggo dipasang kanthi ukuran seragam sing diwiwiti ing sm
breakpoint.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Dianyari pungkasan 3 menit kepungkur
Judhul kertu
Kertu iki nduweni teks pendukung ing ngisor iki minangka timbal alami kanggo isi tambahan.
Dianyari pungkasan 3 menit kepungkur
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Kertu iki nduweni konten sing luwih dawa tinimbang sing pisanan nuduhake aksi dhuwur sing padha.
Dianyari pungkasan 3 menit kepungkur
<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>
Nalika nggunakake klompok kertu karo footer, isi bakal kanthi otomatis baris munggah.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Kertu iki nduweni teks pendukung ing ngisor iki minangka timbal alami kanggo isi tambahan.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Kertu iki nduweni konten sing luwih dawa tinimbang sing pisanan nuduhake aksi dhuwur sing padha.
<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>
kertu kothak
Gunakake sistem kothak Bootstrap lan .row-cols
kelas kanggo ngontrol jumlah kolom kothak (dibungkus kertu) sampeyan nuduhake saben baris. Contone, iki .row-cols-1
laying metu kertu ing siji kolom, lan .row-cols-md-2
pamisah papat SIM kanggo jembaré witjaksono antarane sawetara larik, saka breakpoint medium munggah.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
<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>
Ganti dadi .row-cols-3
lan sampeyan bakal weruh bungkus kertu papat.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
<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>
Nalika sampeyan perlu dhuwur witjaksono, nambah .h-100
menyang kertu. Yen sampeyan pengin dhuwur witjaksono minangka standar, sampeyan bisa nyetel $card-height: 100%
ing Sass.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Iki kertu singkat.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan.
Judhul kertu
Iki minangka kertu sing luwih dawa kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
<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>
Kaya karo klompok kertu, sikil kertu kanthi otomatis baris munggah.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Isi iki rada suwe.
Judhul kertu
Kertu iki nduweni teks pendukung ing ngisor iki minangka timbal alami kanggo isi tambahan.
Judhul kertu
Iki minangka kertu sing luwih akeh kanthi teks dhukungan ing ngisor iki minangka timbal alami kanggo konten tambahan. Kertu iki nduweni konten sing luwih dawa tinimbang sing pisanan nuduhake aksi dhuwur sing padha.
<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
Ing v4
kita digunakake technique CSS-mung kanggo niru prilaku kolom Masonry -kaya, nanging technique iki teka karo persil saka efek sisih karu . Yen sampeyan pengin duwe jinis tata letak ing v5
, sampeyan mung bisa nggunakake Masonry plugin. Masonry ora kalebu ing Bootstrap , nanging kita wis nggawe conto demo kanggo mbantu sampeyan miwiti.
CSS
Variabel
Ditambahake ing v5.2.0Minangka bagéan saka pendekatan variabel CSS Bootstrap sing berkembang, kertu saiki nggunakake variabel CSS lokal .card
kanggo kustomisasi wektu nyata sing ditingkatake. Nilai kanggo variabel CSS disetel liwat Sass, supaya kustomisasi Sass isih didhukung.
--#{$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};
Variabel Sass
$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;