Skip to content

Commit 194f9a0

Browse files
authored
Quick markup improvements for card (#42131)
1 parent 360684d commit 194f9a0

File tree

1 file changed

+6
-4
lines changed
  • site/src/content/docs/components

1 file changed

+6
-4
lines changed

site/src/content/docs/components/card.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import { getData } from '@libs/data'
88

99
Cards are flexible and extensible content containers. They include options for headers and footers, a wide variety of content, contextual background colors, and powerful display options. **Cards have no fixed width to start**, so they’ll naturally fill the full width of its parent element, or slot into your grid columns. This is easily customized with our various [sizing options](#width).
1010

11-
<Example code={`<div class="card" style="width: 280px">
12-
<Placeholder width="100%" height="180" class="card-img-top" text="Image cap" />
11+
<Example code={`<section class="card" style="width: 280px">
1312
<div class="card-body">
1413
<h4 class="card-title">Card title</h4>
1514
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card’s content.</p>
1615
<a href="#" class="btn-solid theme-primary">Go somewhere</a>
1716
</div>
18-
</div>`} />
17+
<Placeholder width="100%" height="180" class="card-img-top" text="Image cap" />
18+
</section>`} />
1919

2020
## How it works
2121

@@ -31,6 +31,8 @@ Cards are built with as little markup and styles as possible, but still manage t
3131

3232
- Cards can have nearly any content, including text, images, lists, and more.
3333

34+
- Our examples use `<div>`s for card elements, but you can use whatever semantic HTML makes sense for your content. Use `<section>` for cards that represent a thematic grouping of content, `<article>` for self-contained compositions like blog posts or news items, or keep using `<div>`s when no additional semantics are needed.
35+
3436
## Content types
3537

3638
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what’s supported.
@@ -56,7 +58,7 @@ Titles, text, and links within cards all have required class names for managing
5658
<Example code={`<div class="card" style="width: 18rem;">
5759
<div class="card-body">
5860
<h4 class="card-title">Example card title</h4>
59-
<h6 class="card-subtitle fg-3">With a card subtitle</h6>
61+
<p class="card-subtitle fg-3">With a card subtitle</p>
6062
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card’s content.</p>
6163
<a href="#">Card link</a>
6264
</div>

0 commit comments

Comments
 (0)