Skip to content

Added explicit commentary to .card-* classes #19476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Cards support a wide variety of content, including images, text, list groups, li
</div>
{% endexample %}

Lists can be added to a card by adding a list group.

{% example html %}
<div class="card">
<ul class="list-group list-group-flush">
Expand All @@ -61,6 +63,8 @@ Cards support a wide variety of content, including images, text, list groups, li
</div>
{% endexample %}

`.card-img-top` places an image to the top of the card. With `.card-text`, text can be added to the card. Text within `.card-text` can also be styled with the standard HTML tags.

{% example html %}
<div class="card">
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
Expand All @@ -70,6 +74,8 @@ Cards support a wide variety of content, including images, text, list groups, li
</div>
{% endexample %}

Card titles are used by adding `.card-title` to a `<h*>` tag. In the same way, links are added and placed next to each other by adding `.card-link` to a `<a>` tag.

{% example html %}
<div class="card card-block">
<h4 class="card-title">Card title</h4>
Expand All @@ -79,6 +85,10 @@ Cards support a wide variety of content, including images, text, list groups, li
</div>
{% endexample %}

Subtitles are used by adding a `.card-subtitle` to an `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-block` item, the card title and subtitle are aligned nicely.

The multiple content types can be easily combined to create the card you need. See below for an example.

{% example html %}
<div class="card">
<div class="card-block">
Expand Down Expand Up @@ -170,6 +180,8 @@ Add an optional header and/or footer within a card.
</div>
{% endexample %}

Card headers can be styled by adding `.card-header` to `<h*>` elements.

{% example html %}
<div class="card">
<h3 class="card-header">Featured</h3>
Expand Down