Cards are flexible containers used for displaying content.
To display a card, use the class a-card
.
<div class="a-card">
<div class="a-card__content">
This is a card
</div>
</div>
Add a title to a card by applying the class a-card__title
to any heading element
h1
- h6
. The class will override the headings default margin for optimal rendering.
This is a titled card
<div class="a-card">
<div class="a-card__content">
<h5 class="a-card__title">Title</h5>
<p class="-text -m--0">This is a titled card</p>
</div>
</div>
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<h5 class="a-card__title">Title</h5>
<p class="-text -mt--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
<button class="a-btn -brand">Link</button>
</div>
</div>
Add a full width image or banner to the top of a card by applying the class a-card__hero
.
Hero Image
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec, ultrices in turpis. Donec sit amet consectetur elit.
<div class="a-card">
<img src="a-card__hero" src="..." alt="Card Image">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec, ultrices in turpis. Donec sit amet consectetur elit.</p>
</div>
</div>
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer">
<button class="a-btn -brand">Link</button>
<button class="a-btn -ml--1">Link</button>
</div>
</div>
Apply the class -align--right
on a-card__footer
to right align its contents.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer -align--right">
<button class="a-btn -brand">Link</button>
<button class="a-btn -ml--1">Link</button>
</div>
</div>
Apply the class -align--center
on a-card__footer
to center align its contents.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer -align--center">
<button class="a-btn -brand">Link</button>
</div>
</div>
Apply the class -noBorder
on a-card__footer
to remove the default border.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer -noBorder">
<button class="a-btn -brand">Link</button>
</div>
</div>
Apply the class -small
on a-card__footer
to reduce its padding.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer -small">
<a class="-text" href="#">Link</a>
</div>
</div>
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
</div>
Apply the class -align--right
on a-card__header
to right align its contents.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header -align--right">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
</div>
Apply the class -align--center
on a-card__header
to center align its contents.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header -align--center">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
</div>
Apply the class -noBorder
on a-card__header
to remove the default border.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header -noBorder">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
</div>
Apply the class -small
on a-card__header
to reduce its padding.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header -small">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
</div>
Further customize cards by adding both headers a-card__header
and footers a-card__footer
.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer">
<button class="a-btn -brand">Link</button>
</div>
</div>
Reduce the size of the header and footer by applying the class -small
to each element.
Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.
<div class="a-card">
<div class="a-card__header -small">
<h5 class="a-card__title">Title</h5>
</div>
<div class="a-card__content">
<p class="-text -m--0">Aenean pretium massa sed vehicula porta. Phasellus id metus felis. Ut felis magna, facilisis ut malesuada nec.</p>
</div>
<div class="a-card__footer -small">
<a class="-text" href="#">Link</a>
</div>
</div>