Skip to content

Commit e4fe18e

Browse files
mdoXhmikosR
authored andcommitted
Add horizontal card example (twbs#27906)
1 parent 3bd9fb3 commit e4fe18e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

site/docs/4.2/components/card.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,28 @@ Note that content should not be larger than the height of the image. If content
397397
{% endcapture %}
398398
{% include callout.html content=callout type="info" %}
399399

400+
## Horizontal
401+
402+
Using a combination of grid and utility classes, cards can be made horizontal in a mobile-friendly and responsive way. In the example below, we remove the grid gutters with `.no-gutters` and use `.col-md-*` classes to make the card horizontal at the `md` breakpoint. Further adjustments may be needed depending on your card content.
403+
404+
{% capture example %}
405+
<div class="card mb-3" style="max-width: 540px;">
406+
<div class="row no-gutters">
407+
<div class="col-md-4">
408+
{% include icons/placeholder.svg width="100%" height="250" class="" text="Image" %}
409+
</div>
410+
<div class="col-md-8">
411+
<div class="card-body">
412+
<h5 class="card-title">Card title</h5>
413+
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
414+
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
415+
</div>
416+
</div>
417+
</div>
418+
</div>
419+
{% endcapture %}
420+
{% include example.html content=example %}
421+
400422
## Card styles
401423

402424
Cards include various options for customizing their backgrounds, borders, and color.

0 commit comments

Comments
 (0)