Nearby lessons
18 of 39π BS5 Cards
π What Are Bootstrap 5 Cards?
Cards are flexible content containers. Use .card as the wrapper, .card-body for the main content. Optionally add .card-header, .card-footer, and .card-img-top or .card-img-bottom for images.
π Basic Card (.card, .card-body)
.card β outer container with border and rounded corners. .card-body β padding and content area. Use .card-title and .card-text for heading and paragraph inside the body.
π Card Header and Footer (.card-header, .card-footer)
.card-header β bar at the top (e.g. title or tabs). .card-footer β bar at the bottom (e.g. βLast updatedβ). Place them as direct children of .card, before or after .card-body.
πΌοΈ Card with Image (.card-img-top, .card-img-bottom)
.card-img-top β image at the top of the card (full width, rounded top). .card-img-bottom β image at the bottom. Put the image before or after .card-body; no wrapper needed.
π¨ Card with Colored Header/Footer
Add background utilities to .card-header or .card-footer: .bg-primary, .bg-success, etc. Use .text-white for light text on dark backgrounds.
π Card Layout (grid)
Use the grid: put each .card in a column (e.g. .col-md-4) so multiple cards sit in a row and stack on small screens.
β Card Best Practices
- .card-title and .card-text for consistent typography inside the body.
- Use .card-img-top for a clear visual hierarchy.
- Use the grid (.row, .col-*) to lay out multiple cards.