Cards
Bootstrap’s cards provide a flexible and extensible content container with multiple variants and options.
About
A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options. If you’re familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails. Similar functionality to those components is available as modifier classes for cards.
Example
Cards are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components. They have no margin by default, so use spacing utilities as needed.
Below is an example of a basic card with mixed content and a fixed width. Cards have no fixed width to start, so they’ll naturally fill the full width of its parent element. This is easily customized with our various sizing options.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere<div class="card" style="width: 20rem;">
<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-red">Go somewhere</a>
</div>
</div>Content types
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what’s supported.
Body
The building block of a card is the .card-body. Use it whenever you need a padded section within a card.
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>Titles, text, and links
Card titles are used by adding .card-title to a <h*> tag. In the same way, links are added and placed next to each other by adding .card-link to an <a> tag.
Subtitles are used by adding a .card-subtitle to a <h*> tag. If the .card-title and the .card-subtitle items are placed in a .card-body item, the card title and subtitle are aligned nicely.
Card title
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
Card link Another link<div class="card" style="width: 20rem;">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">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>Images
.card-img-top and .card-img-bottom respectively set the top and bottom corners rounded to match the card’s borders. With .card-text, text can be added to the card. Text within .card-text can also be styled with the standard HTML tags.
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card" style="width: 20rem;">
<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>Icons
Custom Arizona Bootstrap Styling
Add .card-icon to an icon at the top of the .card-body. It works with Arizona Icons and Material Symbols, and with an inline SVG whose fill or stroke is currentColor. The icon uses the text color, which you can set with .text-{color}. Add aria-hidden="true" to a decorative icon, so screen readers skip it.
Add .bg-cloud and .hover to any card for the brand’s card hover colors: Cloud, then Arizona Blue. Don’t put a button in the card, because the whole card is already a link.
The example uses the outline style of a Material Symbols icon, with font-variation-settings: 'FILL' 0. It also adds .fw-light, for a thinner icon. To match the example, sites may need to update their Material Symbols stylesheet link to allow FILL 0 and weight 300.
Future Students
Become a Wildcat and embrace โBear Down!โ Explore information on applying, transferring, Arizona Online, and more.
<div class="card bg-cloud hover" style="max-width: 20rem;">
<div class="card-body">
<span class="card-icon material-symbols-rounded fw-light" style="font-variation-settings: 'FILL' 0;" aria-hidden="true">person_raised_hand</span>
<h3 class="card-title h5 fw-bold mb-2">
<a href="#top" class="stretched-link text-reset text-decoration-none">Future Students</a>
</h3>
<p class="card-text">Become a Wildcat and embrace โBear Down!โ Explore information on applying, transferring, Arizona Online, and more.</p>
</div>
</div>List groups
Create lists of content in a card with a flush list group.
- An item
- A second item
- A third item
<div class="card" style="width: 20rem;">
<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>- An item
- A second item
- A third item
<div class="card" style="width: 20rem;">
<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>- An item
- A second item
- A third item
<div class="card" style="width: 20rem;">
<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>Kitchen sink
Mix and match multiple content types to create the card you need, or throw everything in there. Shown below are image styles, blocks, text styles, and a list groupโall wrapped in a fixed-width card.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
- An item
- A second item
- A third item
<div class="card" style="width: 20rem;">
<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 and footer
Add an optional header and/or footer within a card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<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-red">Go somewhere</a>
</div>
</div>Card headers can be styled by adding .card-header to <h*> elements.
Featured
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<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-red">Go somewhere</a>
</div>
</div>A well-known quote, contained in a blockquote element.
<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>Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<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-red">Go somewhere</a>
</div>
<div class="card-footer text-body-secondary">
2 days ago
</div>
</div>Sizing
Cards assume no specific width to start, so they’ll be 100% wide unless otherwise stated. You can change this as needed with custom CSS, grid classes, grid Sass mixins, or utilities.
Using grid markup
Using the grid, wrap cards in columns and rows as needed.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<div class="row">
<div class="col-sm-6 mb-3 mb-sm-0">
<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-red">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-red">Go somewhere</a>
</div>
</div>
</div>
</div>Using utilities
Use our handful of available sizing utilities to quickly set a card’s width.
<div class="card w-75 mb-3">
<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-red">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-red">Button</a>
</div>
</div>Using custom CSS
Use custom CSS in your stylesheets or as inline styles to set a width.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<div class="card" style="width: 20rem;">
<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-red">Go somewhere</a>
</div>
</div>Text alignment
You can quickly change the text alignment of any cardโin its entirety or specific partsโwith our text align classes.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<div class="card mb-3" style="width: 20rem;">
<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-red">Go somewhere</a>
</div>
</div>
<div class="card text-center mb-3" style="width: 20rem;">
<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-red">Go somewhere</a>
</div>
</div>
<div class="card text-end" style="width: 20rem;">
<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-red">Go somewhere</a>
</div>
</div>Navigation
Add some navigation to a card’s header (or block) with Bootstrap’s nav components.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<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" aria-disabled="true">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-red">Go somewhere</a>
</div>
</div>Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere<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" aria-disabled="true">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-red">Go somewhere</a>
</div>
</div>Images
Cards include a few options for working with images. Choose from appending “image caps” at either end of a card, overlaying images with card content, or simply embedding the image in a card.
Image caps
Similar to headers and footers, cards can include top and bottom “image caps”โimages at the top or bottom of a card.
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
<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-body-secondary">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-body-secondary">Last updated 3 mins ago</small></p>
</div>
<img src="..." class="card-img-bottom" alt="...">
</div>Image overlays
Turn an image into a card background and overlay your card’s text. Depending on the image, you may or may not need additional styles or utilities.
<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>Horizontal
Using a combination of grid and utility classes, cards can be made horizontal in a mobile-friendly and responsive way. In the example below, we remove the grid gutters with .g-0 and use .col-md-* classes to make the card horizontal at the md breakpoint. Further adjustments may be needed depending on your card content.
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
<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-body-secondary">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>Card styles
Cards include various options for customizing their backgrounds, borders, and color.
Background and color
Added in v5.2.0Set a background-color with contrasting foreground color with our .text-bg-{color} helpers. Previously it was required to manually pair your choice of .text-{color} and .bg-{color} utilities for styling, which you still may use if you prefer.
Red card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Sonoran-Red card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Blue card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Arroyo-Blue card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Azurite card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Tinta card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Cloud card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Caliche card title
Some quick example text to build on the card title and make up the bulk of the card's content.
White card title
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card text-bg-red mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Red 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-sonoran-red mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Sonoran-Red 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-blue mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Blue 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-arroyo-blue mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Arroyo-Blue 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-azurite mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Azurite 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-tinta mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Tinta 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-cloud mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Cloud 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-caliche mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Caliche 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-white mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">White 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>.visually-hidden class.
Border
Use border utilities to change just the border-color of a card. Note that you can put .text-{color} classes on the parent .card or a subset of the card’s contents as shown below.
Red card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Sonoran-Red card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Blue card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Arroyo-Blue card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Azurite card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Tinta card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Cloud card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Caliche card title
Some quick example text to build on the card title and make up the bulk of the card's content.
White card title
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card border-red mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-red">
<h5 class="card-title">Red 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-sonoran-red mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-sonoran-red">
<h5 class="card-title">Sonoran-Red 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-blue mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-blue">
<h5 class="card-title">Blue 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-arroyo-blue mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-arroyo-blue">
<h5 class="card-title">Arroyo-Blue 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-azurite mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-azurite">
<h5 class="card-title">Azurite 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-tinta mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body text-tinta">
<h5 class="card-title">Tinta 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-cloud mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Cloud 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-caliche mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Caliche 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-white mb-3" style="max-width: 20rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">White 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>Borderless and Clickable Cards
Custom Arizona Bootstrap Styling
Remove the border around the card content with .border-0. Use the Stretched Link helper along with the custom Arizona Bootstrap Hover utility to make the entire card clickable with the appropriate hover styling. On a device that can’t hover, such as a phone, a title with .hover-text-underline is always underlined.
Simple Borderless Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Clickable Borderless Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<div class="card border-0 text-bg-gray-200 h-100 mb-3" style="max-width: 20rem;">
<div class="card-body d-flex flex-column">
<h3 class="card-title mb-3 text-left h5 fw-bold">Simple Borderless Card</h3>
<div class="card-text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="mt-auto">
<a href="#top" class="btn btn-blue d-block w-100">Button link</a>
</div>
</div>
</div>
<div class="card border-0 text-bg-gray-200 h-100 hover mb-3" style="max-width: 20rem;">
<div class="card-body d-flex flex-column">
<h3 class="card-title mb-3 text-left h5 fw-bold hover-text-underline">Clickable Borderless Card</h3>
<div class="card-text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="mt-auto">
<a href="#top" class="stretched-link">Text link</a>
</div>
</div>
</div>Clickable Cards With Images
Custom Arizona Bootstrap Styling
Add .hover-img-zoom-in from the Hover utility to the image, so it zooms in on hover. Add .overflow-hidden to the image wrapper and to the card, so the zoom stays inside the image area and the round corners. If the card has no button, put the stretched link on the title. For the hover colors, add .bg-cloud next to .hover, and leave off .text-bg-* and text color utilities, such as .text-white, because they block those colors.
Clickable Borderless Card With Image
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Clickable Card With Hover Colors
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<div class="card border-0 text-bg-blue h-100 hover mb-3 overflow-hidden" style="max-width: 20rem;">
<div class="position-relative overflow-hidden">
<img class="card-img-top img-fluid hover-img-zoom-in" src="/arizona-bootstrap/v5/docs/5.3/assets/img/photo-gallery-demo/gallery-img-1-thumb.jpg" alt="University of Arizona Spring Fling">
</div>
<div class="card-body d-flex flex-column">
<h3 class="card-title mb-3 text-left text-reset h5 fw-bold hover-text-underline">Clickable Borderless Card With Image</h3>
<div class="card-text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="mt-auto">
<a href="#top" class="btn btn-outline-white d-block w-100 stretched-link">Button link</a>
</div>
</div>
</div>
<div class="card bg-cloud h-100 hover mb-3 overflow-hidden" style="max-width: 20rem;">
<div class="position-relative overflow-hidden">
<img class="card-img-top img-fluid hover-img-zoom-in" src="/arizona-bootstrap/v5/docs/5.3/assets/img/photo-gallery-demo/gallery-img-1.jpg" alt="University of Arizona Spring Fling">
</div>
<div class="card-body">
<h3 class="card-title h5 fw-bold mb-2">
<a href="#top" class="stretched-link text-reset text-decoration-none">Clickable Card With Hover Colors</a>
</h3>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>Title on Image
Custom Arizona Bootstrap Styling
Cards with the title on image style put the title of the card on top of the image with a gradient background. This type of card also uses the custom Hover utility. On a device that can’t hover, such as a phone, the title is always underlined.
To make a card with only an image and a title, put the image in a .ratio and .ratio-1x1 wrapper to make it square, and add .object-fit-cover to the image, so any photo fills the square. Add .h-50 to the title, so its gradient covers the bottom half of the image, and put the stretched link on the title.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<div class="card shadow text-bg-white h-100 hover mb-3 overflow-hidden" style="max-width: 20rem;">
<div class="position-relative overflow-hidden">
<img class="card-img-top img-fluid hover-img-zoom-in" src="/arizona-bootstrap/v5/docs/5.3/assets/img/photo-gallery-demo/gallery-img-1-thumb.jpg" alt="University of Arizona Spring Fling">
<div class="card-img-overlay p-0 d-flex flex-column">
<h3 class="card-title text-bg-gradient-blue fw-bold mt-auto mb-0 p-4 pt-8 text-left h5 hover-text-underline">Card Title on Image</h3>
</div>
</div>
<div class="card-body d-flex flex-column">
<div class="card-text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="mt-auto">
<a href="#top" class="btn btn-red d-block w-100 stretched-link">Button link</a>
</div>
</div>
</div>
<div class="card border-0 h-100 hover mb-3 overflow-hidden" style="max-width: 20rem;">
<div class="ratio ratio-1x1 overflow-hidden">
<img class="card-img-top object-fit-cover hover-img-zoom-in" src="/arizona-bootstrap/v5/docs/5.3/assets/img/photo-gallery-demo/gallery-img-4.jpg" alt="Ceiling tiles">
<div class="card-img-overlay p-0 d-flex flex-column">
<h3 class="card-title text-bg-gradient-blue fw-bold h-50 mt-auto mb-0 p-4 d-flex align-items-end h5 hover-text-underline">
<a href="#top" class="stretched-link text-reset text-decoration-none">Card Title on Image Only</a>
</h3>
</div>
</div>
</div>Mixins utilities
You can also change the borders on the card header and footer as needed, and even remove their background-color with .bg-transparent.
Azurite card title
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card border-azurite mb-3" style="max-width: 20rem;">
<div class="card-header bg-transparent border-azurite">Header</div>
<div class="card-body text-azurite">
<h5 class="card-title">Azurite 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-azurite">Footer</div>
</div>Card layout
In addition to styling the content within cards, Bootstrap includes a few options for laying out series of cards. For the time being, these layout options are not yet responsive.
Card groups
Use card groups to render cards as a single, attached element with equal width and height columns. Card groups start off stacked and use display: flex; to become attached with uniform dimensions starting at the sm breakpoint.
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
Card title
This card has supporting text below as a natural lead-in to additional content.
Last updated 3 mins ago
Card title
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.
Last updated 3 mins ago
<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-body-secondary">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-body-secondary">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-body-secondary">Last updated 3 mins ago</small></p>
</div>
</div>
</div>When using card groups with footers, their content will automatically line up.
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This card has supporting text below as a natural lead-in to additional content.
Card title
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.
<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-body-secondary">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-body-secondary">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-body-secondary">Last updated 3 mins ago</small>
</div>
</div>
</div>Grid cards
Use the Bootstrap grid system and its .row-cols classes to control how many grid columns (wrapped around your cards) you show per row. For example, here’s .row-cols-1 laying out the cards on one column, and .row-cols-md-2 splitting four cards to equal width across multiple rows, from the medium breakpoint up.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
<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>Change it to .row-cols-3 and you’ll see the fourth card wrap.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
<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>When you need equal height, add .h-100 to the cards. If you want equal heights by default, you can set $card-height: 100% in Sass.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This is a short card.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content.
Card title
This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
<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>Just like with card groups, card footers will automatically line up.
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Card title
This card has supporting text below as a natural lead-in to additional content.
Card title
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.
<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-body-secondary">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-body-secondary">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-body-secondary">Last updated 3 mins ago</small>
</div>
</div>
</div>
</div>Masonry
In v4 we used a CSS-only technique to mimic the behavior of Masonry-like columns, but this technique came with lots of unpleasant side effects. If you want to have this type of layout in v5, you can just make use of Masonry plugin. Masonry is not included in Bootstrap, but we’ve made a demo example to help you get started.
CSS
Variables
Added in v5.2.0As part of Bootstrap’s evolving CSS variables approach, cards now use local CSS variables on .card for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
--#{$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-title-color: #{$card-title-color};
--#{$prefix}card-subtitle-color: #{$card-subtitle-color};
--#{$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-title-color: null;
$card-subtitle-color: null;
$card-border-width: var(--#{$prefix}border-width);
$card-border-color: var(--#{$prefix}border-color-translucent);
$card-border-radius: var(--#{$prefix}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(var(--#{$prefix}body-color-rgb), .03);
$card-cap-color: null;
$card-height: null;
$card-color: null;
$card-bg: var(--#{$prefix}body-bg);
$card-img-overlay-padding: $spacer;
$card-group-margin: $grid-gutter-width * .5;