A field guide to content containers
Cards.
From a quiet text panel to a full-bleed editorial story, cards make content easier to scan. Learn the Bootstrap 5.3 building blocks, then choose a layout that fits every screen.
A card is a container.
The layout is your choice.
Bootstrap's .card is a flexible content surface. It can hold an image, a title, a short description, metadata, actions, or any combination that serves the story.
The card does not decide how neighboring cards line up. Use normal document flow, Flexbox, CSS Grid, or Bootstrap's responsive row-and-column system around it.
Start with the structure.
A card is useful before it is decorated. Every part is optional; the best version includes only what helps someone understand the content or take the next step.
Build a little more room for the story.
A short supporting line can add context without competing with the headline.
Use the body for the essential message. Keep the title clear, the description concise, and the next step easy to find.
Explore the card parts.card · .card-body · .card-title<article class="card">
<img class="card-img-top" src="/images/story.jpg" alt="">
<div class="card-body">
<h2 class="card-title">A clear headline</h2>
<p class="card-text">One useful sentence of context.</p>
<a class="card-link" href="/story">Read the story</a>
</div>
</article>A small set of parts.
Plenty of combinations.
Bootstrap's card classes describe the piece of the component. Use standard utilities for spacing, color, alignment, and shape rather than looking for a separate class for every design.
.card
The root container draws a background, border, radius, and vertical content flow. Add .h-100 when cards in one grid row should stretch to equal height.
.card-body
Adds the standard inner padding. It is optional when using a header, footer, list group, or image without a padded content block.
.card-title · .card-subtitle
Use a real heading element for the title. The classes style it; they do not choose its heading level or create semantic structure.
.card-text · .card-link
Use .card-text for supporting copy and .card-link for a simple link. Buttons and other content can be placed in the body too.
.card-header · .card-footer
Optional top and bottom areas for a category, date, author, controls, or compact metadata. Utility classes can align their contents.
.card-img · .card-img-top · .card-img-bottom · .card-img-overlay
Place media above or below the body. Add .card-img-overlay to layer readable content over an image; provide a contrast-safe overlay.
.list-group.list-group-flush
Attach compact rows of related details between the header, body, and footer without adding a separate outer border.
.text-bg-primary
Use Bootstrap's .text-bg-* helpers for contextual background and foreground colors, then check contrast for your content.
.card-group
Cards stack below 576px, then share an equal-width row and touch at larger sizes. For responsive gaps, uneven widths, or precise breakpoints, use a grid.
.card-header-tabs · .card-header-pills
Position a Bootstrap navigation list in the header. These classes style its placement; links or tab behavior still need to be wired intentionally.
.text-start · .text-center · .w-* · .h-100
Utilities set text alignment and sizing. For responsive widths, prefer grid columns or a CSS layout rather than a fixed card width.
--bs-card-spacer-* · --bs-card-border-* · --bs-card-bg
Bootstrap also exposes variables for title and subtitle color, cap padding and color, card height and text color, image overlay padding, and card-group spacing.
Bootstrap 5 note The old .card-deck and .card-columns patterns are not part of Bootstrap 5. Use .row, columns, or your own CSS Grid instead.
Change the surface.
Keep the hierarchy.
Bootstrap cards do not have a fixed set of visual themes. Combine text and background helpers, borders, radius, shadows, and spacing to match the job of the content.
A focused announcement.
Use a dark surface for one message that needs a clear moment.
text-bg-dark · border-0A confident callout.
Pair a contextual color with concise copy, not a dense article.
text-bg-primaryReady to publish
A restrained border gives status a place without adding visual noise.
- Review copy 01
- Check contrast 02
- Publish update 03
Keep related views together.
Use .card-header-pills or .card-header-tabs to align a nav with the card cap.
For real tabs, add working panels and the matching accessible tab behavior.
border-0border-primaryrounded-4shadow-smp-*text-bg-*<article class="card text-bg-dark border-0 shadow-sm rounded-4">
<div class="card-body p-4">...</div>
</article>
.brand-card {
--bs-card-spacer-y: 1.5rem;
--bs-card-spacer-x: 1.5rem;
--bs-card-title-spacer-y: .75rem;
--bs-card-title-color: #20372d;
--bs-card-subtitle-color: #758279;
--bs-card-border-width: 0;
--bs-card-bg: #f1f4ec;
--bs-card-border-color: transparent;
--bs-card-border-radius: 1rem;
--bs-card-inner-border-radius: .75rem;
--bs-card-height: auto;
--bs-card-cap-padding-y: .75rem;
--bs-card-cap-padding-x: 1.5rem;
--bs-card-cap-bg: transparent;
--bs-card-cap-color: #68766d;
--bs-card-color: #30463a;
--bs-card-img-overlay-padding: 1.25rem;
--bs-card-group-margin: 1rem;
}
Card CSS variables are useful for a repeated theme. For one-off spacing or shape, the built-in utilities are usually simpler.
No .row required.
Start with the parent.
A card works on its own in normal document flow. To arrange several cards, use CSS Grid or Flexbox on their parent. The card stays the content unit; the parent owns the layout.
A card can simply be a card.
No grid class is needed when the page already provides the width and position.
Set a width on the card or its wrapper only when the design needs one.
Auto-fit columns
Let available space decide how many fit.
Wrapped rows
Use .d-flex .flex-wrap .gap-3 for flexible collections.
Keep it independent
Cards do not need to know their siblings' widths.
<div class="auto-card-grid">
<article class="card">...</article>
<article class="card">...</article>
<article class="card">...</article>
</div>
.auto-card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
gap: 1rem;
}A row you can browse.
Useful for a short set of featured stories on mobile. Keep a visible edge of the next card so the horizontal movement is discoverable.
Make the first view count.
A short story for the space between scrolls.
Keep details in reach.
A useful summary can lead to a deeper page.
Leave room to breathe.
A calm rhythm makes a collection easier to scan.
Bootstrap utilities work too Use .d-flex, .flex-wrap, and .gap-* for flexible layouts. Use native CSS Grid when the number and minimum width of columns should adapt automatically. .d-grid is handy for a simple one-column stack, but does not define a card grid for you.
Let the columns
set the rhythm.
Bootstrap's grid is the most familiar way to build card collections. Put each card inside a .col; use .row-cols-* for equal-width cards or explicit column widths for a feature layout.
One clear idea.
Each column contains a complete card, not a fragment of one.
See the breakpointsOne shared system.
Consistent gutters keep the collection together as it reflows.
Review the partsOne next step.
Keep actions consistent and aligned when content lengths vary.
Check the detailsrow row-cols-1 row-cols-sm-2 row-cols-xl-3 g-3Each .col holds one .card.h-100.Need one card to lead?
Set different widths on the columns. On small screens both cards stack; at the large breakpoint, the feature gets two-thirds of the row.
Give the most important story more room.
A mixed-width layout can express hierarchy without changing the card component.
Keep the supporting detail close.
Use one parent row and let the columns decide the width.
<div class="row g-3">
<div class="col-12 col-lg-8">
<article class="card h-100">...</article>
</div>
<div class="col-12 col-lg-4">
<article class="card h-100">...</article>
</div>
</div>
.row provides gutters, .col-* sets width, and .h-100 lets cards fill the column. The card itself remains independent of the layout.
Design small first.
Then add space.
Bootstrap breakpoints are minimum widths. Start with a comfortable single-column card on mobile, then introduce more columns as the content and available space allow.
| Breakpoint | Viewport | Common card decision | Example class |
|---|---|---|---|
| xs / default | Below 576px | One column; full-width cards; stack actions. | row-cols-1 |
| sm | 576px and up | Two compact cards when the text still has room. | row-cols-sm-2 |
| md | 768px and up | Start a horizontal image-and-copy card. | col-md-4 |
| lg | 992px and up | Use a feature card beside supporting content. | col-lg-8 |
| xl | 1200px and up | Show three editorial cards with comfortable gutters. | row-cols-xl-3 |
| xxl | 1400px and up | Increase catalog density if card content stays readable. | row-cols-xxl-4 |
row-cols-1 row-cols-sm-2 row-cols-lg-3Begin with one card per row; add columns only when labels and actions still fit.
col-12 col-lg-8 + col-12 col-lg-4Stack the feature and supporting card on mobile, then create hierarchy on desktop.
card h-100 + body d-flex flex-columnUse mt-auto on repeated actions to align them at the foot of each card.
<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 row-cols-xxl-4 g-3 g-lg-4">
<div class="col">
<article class="card h-100">
<div class="card-body d-flex flex-column">
<h2 class="card-title h5">A useful title</h2>
<p class="card-text">A short description.</p>
<a class="card-link mt-auto" href="/details">Read more</a>
</div>
</article>
</div>
<!-- Repeat one .col per card -->
</div>
At xs, row-cols-1 applies. Each later class takes effect at its breakpoint and above; no JavaScript is needed.
Let content set the breakpoint. Bootstrap's breakpoint names are tools, not design rules. If a title wraps awkwardly or a button becomes cramped, keep fewer columns for longer.
One component.
Many useful roles.
Use the same card foundation for editorial, commerce, people, data, learning, and pricing. Change the information hierarchy to suit each job, not just the colors.
Everyday ceramic cup
A product card makes price, details, and the next step easy to compare.
Maya Chen
Product designer shaping useful digital experiences with thoughtful detail.
See the card anatomy18.4% vs. last week
A dashboard card puts one useful signal before its supporting trend.
A practical guide to visual systems
A learning card can show progress without letting the progress bar replace the course title.
Make room to grow.
- Unlimited project cards
- Shared design library
- Responsive templates
Good for events, updates, and search results.
Stack image and copy by default; place them side by side only when the medium breakpoint gives each enough room.
A conversation about making things that last.
A horizontal card is a content choice, not a new Bootstrap component. Use the same grid utilities inside the card.
See responsive rulesMake the card easy
to read and use.
The .card class is visual styling, not semantic meaning. Choose elements and interaction patterns that explain what the content is and what people can do.
Choose the right element
Use <article> for a self-contained story or product. Use a neutral <div> for a purely visual grouping.
Keep a clear heading order
Use a real heading for the title and select its level based on the page outline, not the desired font size.
Make actions real
Use links to navigate and buttons to perform actions. Avoid making a whole card clickable with a pointer-only handler.
Protect image text
Describe meaningful images, use an empty alt for decoration, and add a strong gradient or solid surface behind overlay copy.
Keep focus visible
Links and buttons need a visible keyboard focus state. Avoid nested links, or a button inside a stretched card link.
Let content reflow
Avoid fixed card heights for variable text. Use .h-100 for a grid row and keep image ratios separate from text height.
A useful test: Can someone understand each card and reach each action using only the page headings, links, and keyboard focus? If not, simplify the card's interaction model.
A practical starting point.
Use this checklist when moving from a sketch to a working card collection.
Choose content. Give each card one clear purpose and a useful title.
Choose layout. Normal flow, Flexbox, CSS Grid, or Bootstrap .row and .col.
Set the mobile view. Start stacked, then add columns and horizontal media at measured breakpoints.
Finish with utilities. Apply consistent gutters, spacing, border, radius, color, and image ratio.
Check the experience. Review contrast, heading order, focus, alt text, and content overflow.