![]() |
VOOZH | about |
In Bootstrap 5, Images can be used similarly to headers and footers of the cards. These images are called Card Image Caps. A card can contain a top image or bottom image or both at the same time.
Bootstrap 5 Cards Image Caps Classes:
Syntax:
<div class="card"> <img src="..." class="card-img-top" /> <div class="card-body">...</div> <img src="..." class="card-img-bottom" /> </div>
Example 1: In this example, we used the card-img-top class of the card to provide an image as the top cap.
Output:
Example 2: In this example, we used the card-img-bottom class to use the image as the bottom cap of the card.
Output:
Reference: https://getbootstrap.com/docs/5.2/components/card/#image-caps