Cards act as entry points to more detailed information and provide a preview of the detail a user will see when they select a card.
Best practices
Cards are an effective component when the following guidelines are considered:
Present one idea per card. If there are multiple ideas, break them out into separate cards.
Cards must always include a title and can include intro copy and a subtitle.
Titles and subtitles must follow proper page heading structure.
The examples below all start at <h2>; please adjust your code accordingly.
For cards that link to anchored sections on the page — and only have a title — use <p> for the title.
Optionally, cards can also include an image or icon. In this case, always use a unique image or icon on each card and ensure the icon is relevant and easy to understand.
The entire card should function as a link to the destination. Optionally, a button may be included to link to the destination.
Supporting links may be added to enable actions like sharing. Cards should not have more than one destination but can have multiple supplemental actions.
Provide visual hierarchy to the content to increase the cards focus and legibility.
How it works
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.
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.
Use card body whenever you need a padded section within a card but don’t use this style without the components and formatting mentioned as best practices.
Titles, text, and links
Card titles are used by adding .card-title to a <h*> tag. For titles of cards that link to anchored sections on the page — and only have a title — use <p> instead of <h*>. Use .card-title-sm for titles of cards within narrower columns. If text is still too wide and words are breaking, a wider column needed.
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 titles and subtitles must follow proper page heading structure.
Links are added and placed next to each other by adding .card-link to an <a> tag.
With .card-text, text can be added to the card. Text within .card-text can also be styled with the standard HTML tags.
Card title
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
The entire card should be a link to the main destination. To make the entire card a link add .link to the .card and then add a link with the class .full-card-link. Add an aria-label to the link so that it is accessible.
Card title
A quick example to demonstrate full card links.
Images
.card-img-top places an image to the top of the card.
Some quick example text to build on the card title and make up the bulk of the card's content.
Icons
Add .card-icon to .card-img-top along with your icon classes for icons as card images.
Some quick example text to build on the card title and make up the bulk of the card's content.
List groups
Add supplemental actions to a card with a flush list group.
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.
Card title
Some quick example text.
Card title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.