In Bootstrap 5, cards are versatile components used to display content in a visually appealing and organized manner. Cards can contain various types of content such as images, text, buttons, and more. Here's an example of how to create a basic card in Bootstrap 5:
html
<div class="card">
<img src="image.jpg" class="card-img-top" alt="Image">
<div class="card-body">
<h5 class="card-title">Card Title</h5>
<p class="card-text">Some example text.</p>
<a href="#" class="btn btn-primary">Read More</a>
</div>
</div>
In this example, a simple card is created using the `<div>` element with the class `card`. The content of the card is structured within the card body, represented by another `<div>` element with the class `card-body`.
Inside the card body, you can include various elements like headings (`<h5>` in this example), paragraphs (`<p>`), buttons (`<a>` with the `btn` and `btn-primary` classes in this example), and more. You can customize the appearance of these elements and apply different Bootstrap classes to achieve the desired styling.
The `<img>` tag with the class `card-img-top` is used to display an image at the top of the card. You can replace `image.jpg` with the URL or path to your desired image file.
Bootstrap 5 also provides additional card styles, such as header and footer sections, card decks, card columns, and more. You can refer to the Bootstrap documentation for more details and advanced options on creating and styling cards in Bootstrap 5.
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc