Cards group related content in a bordered surface: card → card-body, optional card-header, card-footer, and card-img-top. Use card-title and card-text for inner typography.
Layout tips
- Equal heights in grids: add
h-100on the card inside arow - Horizontal cards:
row g-0inside the card with image + body columns - Subtle depth:
shadow-smutility alongside default border
Cards are Bootstrap’s answer to repeated “panel” UI—similar to composing Tailwind utilities into a reusable card component, but the structure is prescribed.
Important interview questions and answers
- Q: card vs well/jumbotron (legacy)?
A: Bootstrap 5 standardized on cards; jumbotron was removed—use utilities + cards for hero blocks. - Q: How do card grids stay equal height?
A: Parent row with columns;h-100on each card so flex/grid stretches them.
Self-check
- Name the three optional sections besides
card-body. - Which utility prevents short cards in a row from looking uneven?