A card is a box with optional image, header, body and footer.
.card,.card-body,.card-title,.card-text.card-img-top: an image at the top..card-header/.card-footer
Place cards in grid columns to make product or blog listings.
Flexible content containers.
✍️ 3 exercises + code challenge in this lessonA card is a box with optional image, header, body and footer.
.card, .card-body, .card-title, .card-text.card-img-top: an image at the top..card-header / .card-footerPlace cards in grid columns to make product or blog listings.
Mastering Bootstrap Cards helps you write clean and reliable Bootstrap code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<div class="container py-3">
<div class="row g-3">
<div class="col-sm-6">
<div class="card h-100 shadow-sm">
<img src="https://picsum.photos/id/180/400/200" class="card-img-top" alt="Laptop">
<div class="card-body">
<h5 class="card-title">Web Development</h5>
<p class="card-text">Build fast, responsive websites.</p>
<a href="#" class="btn btn-primary">Learn more</a>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card h-100">
<div class="card-header">Featured</div>
<div class="card-body">
<h5 class="card-title">Python Course</h5>
<p class="card-text">From basics to automation.</p>
</div>
<div class="card-footer text-body-secondary">Starts next week</div>
</div>
</div>
</div>
</div>
Check what you learned in “Bootstrap Cards”.
The main content area of a card.
<div class="card"> <div class="">Text</div> </div>
Which class puts an image at the top of a card?
Build a card with a card-body that contains an h5.card-title "Python".
Free sign-in required · Google login available
Stuck on something?
Ask the community in the CodesInTech forum.
Need a developer?
Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.
Explore Our Services