cards provide a flexible and extensible content container with multiple variants and options.
Cards are built with as little markup and styles as possible, but still
manage to deliver a ton of control and customization.
style="width: 12rem"
to the card to decide the card width.
<div class="card" style="width: 12rem">
<div class="card-img">
<img src="https://picsum.photos/200/200"
/>
</div>
<div class="card-header">Card
Header</div>
<div class="card-body">
Some quick example text to build on the card
title and make up the
bulk of the card's content.
</div>
<div class="card-footer">
<button class="btn primary">Card
Button</button>
</div>
</div>
Such a simple card can be created by adding the
.card-body
. They are mainly used to display only the
content of the card.
<div class="card" style="width: 20rem">
<div class="card-body">
Some quick example text to build on the card
title and make up the
bulk of the card's content.
</div>
</div>
Cards can also be given a header and footer. These are optional, and can be used for things like titles, subtitles, and action links.
<div class="card" style="width: 12rem">
<div class="card-header">Card
Header</div>
<div class="card-body">
Some quick example text to build on the card
title and make up the
bulk of the card's content.
</div>
<div class="card-footer">
<button class="btn primary">Button 1
</button>
<button class="btn primary">Button 2
</button>
</div>
</div>
Cards can also be used by showing only the image and bpdy. This is done
by adding the .card-img
and
.card-body
classes.
<div class="card" style="width: 12rem">
<img class="card-img-top"
src="https://picsum.photos/200/200" />
<div class="card-body">
Some quick example text to build on the card
title and make up the
bulk of the card's content.
</div>
</div>