card.md 23.5 KB
Newer Older
Mark Otto's avatar
cards  
Mark Otto committed
1
---
Mark Otto's avatar
Mark Otto committed
2
layout: docs
Mark Otto's avatar
cards  
Mark Otto committed
3
title: Cards
4
group: components
Mark Otto's avatar
cards  
Mark Otto committed
5
6
7
8
---

A **card** is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.

Mark Otto's avatar
Mark Otto committed
9
If you're familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails. Similar functionality to those components is available as modifier classes for cards.
Mark Otto's avatar
cards  
Mark Otto committed
10

Mark Otto's avatar
Mark Otto committed
11
12
13
14
15
## Contents

* Will be replaced with the ToC, excluding the "Contents" header
{:toc}

16
## Example
Mark Otto's avatar
cards  
Mark Otto committed
17

18
Cards require a small amount of markup and classes to provide you with as much control as possible. These classes and markup are flexible though and can typically be remixed and extended with ease. For example, if your card has no flush content like images, feel free to put the `.card-block` class on the `.card` element to consolidate your markup.
Mark Otto's avatar
cards  
Mark Otto committed
19
20
21

{% example html %}
<div class="card">
XhmikosR's avatar
XhmikosR committed
22
  <img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
23
24
25
  <div class="card-block">
    <h4 class="card-title">Card title</h4>
    <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>
26
    <a href="#" class="btn btn-primary">Go somewhere</a>
27
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
28
29
30
</div>
{% endexample %}

31
## Content types
Mark Otto's avatar
Mark Otto committed
32

33
Cards support a wide variety of content, including images, text, list groups, links, and more. Mix and match multiple content types to create the card you need.
Mark Otto's avatar
Mark Otto committed
34

35
36
{% example html %}
<div class="card">
XhmikosR's avatar
XhmikosR committed
37
  <img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  <div class="card-block">
    <h4 class="card-title">Card title</h4>
    <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>
  </div>
  <ul class="list-group list-group-flush">
    <li class="list-group-item">Cras justo odio</li>
    <li class="list-group-item">Dapibus ac facilisis in</li>
    <li class="list-group-item">Vestibulum at eros</li>
  </ul>
  <div class="card-block">
    <a href="#" class="card-link">Card link</a>
    <a href="#" class="card-link">Another link</a>
  </div>
</div>
{% endexample %}
Mark Otto's avatar
Mark Otto committed
53

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

56
57
58
59
60
61
62
63
64
65
{% example html %}
<div class="card">
  <ul class="list-group list-group-flush">
    <li class="list-group-item">Cras justo odio</li>
    <li class="list-group-item">Dapibus ac facilisis in</li>
    <li class="list-group-item">Vestibulum at eros</li>
  </ul>
</div>
{% endexample %}

66
67
`.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.

Mark Otto's avatar
Mark Otto committed
68
{% example html %}
69
<div class="card">
XhmikosR's avatar
XhmikosR committed
70
  <img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
71
72
73
  <div class="card-block">
    <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>
  </div>
Mark Otto's avatar
Mark Otto committed
74
</div>
75
76
{% endexample %}

77
78
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.

79
{% example html %}
80
81
82
83
84
<div class="card card-block">
  <h4 class="card-title">Card title</h4>
  <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>
  <a href="#" class="card-link">Card link</a>
  <a href="#" class="card-link">Another link</a>
Mark Otto's avatar
Mark Otto committed
85
</div>
86
87
{% endexample %}

Floris Verburg's avatar
Floris Verburg committed
88
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.
89

Floris Verburg's avatar
Floris Verburg committed
90
The multiple content types can be easily combined to create the card you need. See below for an example.
91

92
93
94
95
96
97
{% example html %}
<div class="card">
  <div class="card-block">
    <h4 class="card-title">Card title</h4>
    <h6 class="card-subtitle text-muted">Support card subtitle</h6>
  </div>
XhmikosR's avatar
XhmikosR committed
98
  <img data-src="holder.js/100px180/?text=Image" alt="Card image">
99
100
101
102
103
  <div class="card-block">
    <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>
    <a href="#" class="card-link">Card link</a>
    <a href="#" class="card-link">Another link</a>
  </div>
Mark Otto's avatar
Mark Otto committed
104
105
106
</div>
{% endexample %}

107
108
## Sizing

109
Constrain the width of cards via custom CSS, our predefined grid classes, or with custom styles using our grid mixins.
Mark Otto's avatar
Mark Otto committed
110
111
112

Using the grid:

Mark Otto's avatar
Mark Otto committed
113
114
115
{% example html %}
<div class="row">
  <div class="col-sm-6">
116
    <div class="card card-block">
Mark Otto's avatar
Mark Otto committed
117
118
119
120
121
122
      <h3 class="card-title">Special title treatment</h3>
      <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
  <div class="col-sm-6">
123
    <div class="card card-block">
Mark Otto's avatar
Mark Otto committed
124
125
126
127
128
129
130
131
      <h3 class="card-title">Special title treatment</h3>
      <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
132
133
134
Using custom widths:

{% example html %}
135
<div class="card card-block" style="width: 18rem;">
Mark Otto's avatar
Mark Otto committed
136
137
138
139
140
141
142
  <h3 class="card-title">Special title treatment</h3>
  <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  <a href="#" class="btn btn-primary">Go somewhere</a>
</div>
{% endexample %}

## Text alignment
Mark Otto's avatar
cards  
Mark Otto committed
143

144
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/components/utilities/#text-alignment).
Mark Otto's avatar
cards  
Mark Otto committed
145
146

{% example html %}
147
<div class="card card-block">
Mark Otto's avatar
cards  
Mark Otto committed
148
149
150
151
152
  <h4 class="card-title">Special title treatment</h4>
  <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  <a href="#" class="btn btn-primary">Go somewhere</a>
</div>

153
<div class="card card-block text-xs-center">
Mark Otto's avatar
cards  
Mark Otto committed
154
155
156
157
158
  <h4 class="card-title">Special title treatment</h4>
  <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  <a href="#" class="btn btn-primary">Go somewhere</a>
</div>

159
<div class="card card-block text-xs-right">
Mark Otto's avatar
cards  
Mark Otto committed
160
161
162
163
164
165
  <h4 class="card-title">Special title treatment</h4>
  <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
  <a href="#" class="btn btn-primary">Go somewhere</a>
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
166
## Header and footer
Mark Otto's avatar
cards  
Mark Otto committed
167
168
169
170
171
172
173
174

Add an optional header and/or footer within a card.

{% example html %}
<div class="card">
  <div class="card-header">
    Featured
  </div>
175
176
177
  <div class="card-block">
    <h4 class="card-title">Special title treatment</h4>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
178
179
180
181
182
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
{% endexample %}

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

185
186
187
188
189
190
{% example html %}
<div class="card">
  <h3 class="card-header">Featured</h3>
  <div class="card-block">
    <h4 class="card-title">Special title treatment</h4>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
191
192
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
193
</div>
Mark Otto's avatar
Mark Otto committed
194
{% endexample %}
Mark Otto's avatar
cards  
Mark Otto committed
195

Mark Otto's avatar
Mark Otto committed
196
{% example html %}
Mark Otto's avatar
cards  
Mark Otto committed
197
198
199
200
<div class="card">
  <div class="card-header">
    Quote
  </div>
201
202
203
204
205
206
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
207
208
209
210
</div>
{% endexample %}

{% example html %}
211
<div class="card text-xs-center">
Mark Otto's avatar
cards  
Mark Otto committed
212
213
214
  <div class="card-header">
    Featured
  </div>
215
216
217
218
219
  <div class="card-block">
    <h4 class="card-title">Special title treatment</h4>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
220
221
222
223
224
225
  <div class="card-footer text-muted">
    2 days ago
  </div>
</div>
{% endexample %}

226
## Header nav
227

228
Use Bootstrap's nav pills or tabs within a card header. Be sure to always include a `.pull-*-*` utility class for proper alignment.
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275

{% example html %}
<div class="card text-xs-center">
  <div class="card-header">
    <ul class="nav nav-tabs card-header-tabs pull-xs-left">
      <li class="nav-item">
        <a class="nav-link active" href="#">Active</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
  </div>
  <div class="card-block">
    <h4 class="card-title">Special title treatment</h4>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
{% endexample %}

{% example html %}
<div class="card text-xs-center">
  <div class="card-header">
    <ul class="nav nav-pills card-header-pills pull-xs-left">
      <li class="nav-item">
        <a class="nav-link active" href="#">Active</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
  </div>
  <div class="card-block">
    <h4 class="card-title">Special title treatment</h4>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
276
## Image caps
Mark Otto's avatar
cards  
Mark Otto committed
277
278
279
280
281

Similar to headers and footers, cards include top and bottom image caps.

{% example html %}
<div class="card">
XhmikosR's avatar
XhmikosR committed
282
  <img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
283
284
285
286
287
  <div class="card-block">
    <h4 class="card-title">Card title</h4>
    <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>
    <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
288
289
</div>
<div class="card">
290
291
292
293
294
  <div class="card-block">
    <h4 class="card-title">Card title</h4>
    <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>
    <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  </div>
XhmikosR's avatar
XhmikosR committed
295
  <img class="card-img-bottom" data-src="holder.js/100px180/" alt="Card image cap">
Mark Otto's avatar
cards  
Mark Otto committed
296
297
298
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
299
## Image overlays
Mark Otto's avatar
cards  
Mark Otto committed
300

301
Turn an image into a card background and overlay your card's text. Depending on the image, you may or may not need `.card-inverse` (see below).
Mark Otto's avatar
cards  
Mark Otto committed
302
303
304

{% example html %}
<div class="card card-inverse">
XhmikosR's avatar
XhmikosR committed
305
  <img class="card-img" data-src="holder.js/100px270/#55595c:#373a3c/text:Card image" alt="Card image">
Mark Otto's avatar
cards  
Mark Otto committed
306
307
308
309
310
311
312
313
  <div class="card-img-overlay">
    <h4 class="card-title">Card title</h4>
    <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>
    <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  </div>
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
314
## Inverted text
Mark Otto's avatar
cards  
Mark Otto committed
315

316
317
Cards include a class for quickly toggling **the text color**. By default, cards use dark text and assume a light background. **Add `.card-inverse` for white text** and specify the `background-color` and `border-color` to go with it.

318
You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants).
Mark Otto's avatar
cards  
Mark Otto committed
319
320
321

{% example html %}
<div class="card card-inverse" style="background-color: #333; border-color: #333;">
322
323
324
  <div class="card-block">
    <h3 class="card-title">Special title treatment</h3>
    <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
325
    <a href="#" class="btn btn-primary">Go somewhere</a>
326
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
327
328
329
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
330
## Background variants
Mark Otto's avatar
cards  
Mark Otto committed
331

332
Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.**
Mark Otto's avatar
cards  
Mark Otto committed
333
334

{% example html %}
335
<div class="card card-inverse card-primary text-xs-center">
336
337
338
339
340
341
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
342
</div>
343
<div class="card card-inverse card-success text-xs-center">
344
345
346
347
348
349
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
350
</div>
351
<div class="card card-inverse card-info text-xs-center">
352
353
354
355
356
357
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
358
</div>
359
<div class="card card-inverse card-warning text-xs-center">
360
361
362
363
364
365
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
366
</div>
367
<div class="card card-inverse card-danger text-xs-center">
petetnt's avatar
petetnt committed
368
369
370
371
372
373
374
375
376
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
{% endexample %}

377
378
379
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
{{ callout-include | markdownify }}

petetnt's avatar
petetnt committed
380
381
## Outline variants

Mark Otto's avatar
Mark Otto committed
382
In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card.
petetnt's avatar
petetnt committed
383
384

{% example html %}
Mark Otto's avatar
Mark Otto committed
385
<div class="card card-outline-primary text-xs-center">
petetnt's avatar
petetnt committed
386
387
388
389
390
391
392
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
393
<div class="card card-outline-secondary text-xs-center">
petetnt's avatar
petetnt committed
394
395
396
397
398
399
400
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
401
<div class="card card-outline-success text-xs-center">
petetnt's avatar
petetnt committed
402
403
404
405
406
407
408
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
409
<div class="card card-outline-info text-xs-center">
petetnt's avatar
petetnt committed
410
411
412
413
414
415
416
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
417
<div class="card card-outline-warning text-xs-center">
petetnt's avatar
petetnt committed
418
419
420
421
422
423
424
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
425
<div class="card card-outline-danger text-xs-center">
426
427
428
429
430
431
  <div class="card-block">
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
    </blockquote>
  </div>
Mark Otto's avatar
cards  
Mark Otto committed
432
433
434
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
435
## Groups
Mark Otto's avatar
cards  
Mark Otto committed
436

Heinrich Fenkart's avatar
Heinrich Fenkart committed
437
Use card groups to render cards as a single, attached element with equal width and height columns. By default, card groups use `display: table;` and `table-layout: fixed;` to achieve their uniform sizing. However, enabling [flexbox mode]({{ site.baseurl }}/getting-started/flexbox) can switch that to use `display: flex;` and provide the same effect.
Mark Otto's avatar
cards  
Mark Otto committed
438

439
440
Only applies to small devices and above.

Mark Otto's avatar
cards  
Mark Otto committed
441
442
443
{% example html %}
<div class="card-group">
  <div class="card">
XhmikosR's avatar
XhmikosR committed
444
    <img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
445
446
447
448
449
    <div class="card-block">
      <h4 class="card-title">Card title</h4>
      <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>
      <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
    </div>
Mark Otto's avatar
cards  
Mark Otto committed
450
451
  </div>
  <div class="card">
XhmikosR's avatar
XhmikosR committed
452
    <img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
453
454
455
456
457
    <div class="card-block">
      <h4 class="card-title">Card title</h4>
      <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
      <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
    </div>
Mark Otto's avatar
cards  
Mark Otto committed
458
459
  </div>
  <div class="card">
XhmikosR's avatar
XhmikosR committed
460
    <img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
461
462
463
464
465
    <div class="card-block">
      <h4 class="card-title">Card title</h4>
      <p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
      <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
    </div>
Mark Otto's avatar
cards  
Mark Otto committed
466
467
468
469
  </div>
</div>
{% endexample %}

470
## Decks
Mark Otto's avatar
cards  
Mark Otto committed
471

472
473
Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.

474
475
Only applies to small devices and above.

Heinrich Fenkart's avatar
Heinrich Fenkart committed
476
**ProTip!** If you enable [flexbox mode]({{ site.baseurl }}/getting-started/flexbox/), you can remove the `.card-deck-wrapper`.
Mark Otto's avatar
cards  
Mark Otto committed
477
478

{% example html %}
479
480
<div class="card-deck-wrapper">
  <div class="card-deck">
Mark Otto's avatar
cards  
Mark Otto committed
481
    <div class="card">
XhmikosR's avatar
XhmikosR committed
482
      <img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
483
484
485
486
487
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
        <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
      </div>
Mark Otto's avatar
cards  
Mark Otto committed
488
489
    </div>
    <div class="card">
XhmikosR's avatar
XhmikosR committed
490
      <img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
491
492
493
494
495
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
        <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
      </div>
Mark Otto's avatar
cards  
Mark Otto committed
496
497
    </div>
    <div class="card">
XhmikosR's avatar
XhmikosR committed
498
      <img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
499
500
501
502
503
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
        <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
      </div>
Mark Otto's avatar
cards  
Mark Otto committed
504
505
506
507
508
    </div>
  </div>
</div>
{% endexample %}

Mark Otto's avatar
Mark Otto committed
509
## Columns
Mark Otto's avatar
cards  
Mark Otto committed
510

511
Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Cards are ordered from top to bottom and left to right when wrapped in `.card-columns`.
512
513

Only applies to small devices and above.
514

515
**Heads up!** This is **not available in IE9 and below** as they have no support for the [`column-*` CSS properties](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts).
Mark Otto's avatar
cards  
Mark Otto committed
516
517
518
519

{% example html %}
<div class="card-columns">
  <div class="card">
Mark Otto's avatar
Mark Otto committed
520
    <img class="card-img-top img-fluid" data-src="holder.js/100px160/" alt="Card image cap">
521
522
523
524
    <div class="card-block">
      <h4 class="card-title">Card title that wraps to a new line</h4>
      <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
    </div>
Mark Otto's avatar
cards  
Mark Otto committed
525
  </div>
526
  <div class="card card-block">
Mark Otto's avatar
cards  
Mark Otto committed
527
528
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
529
530
531
532
533
      <footer>
        <small class="text-muted">
          Someone famous in <cite title="Source Title">Source Title</cite>
        </small>
      </footer>
Mark Otto's avatar
cards  
Mark Otto committed
534
535
536
    </blockquote>
  </div>
  <div class="card">
Mark Otto's avatar
Mark Otto committed
537
    <img class="card-img-top img-fluid" data-src="holder.js/100px160/" alt="Card image cap">
538
539
540
541
542
    <div class="card-block">
      <h4 class="card-title">Card title</h4>
      <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
      <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
    </div>
Mark Otto's avatar
cards  
Mark Otto committed
543
  </div>
544
  <div class="card card-block card-inverse card-primary text-xs-center">
Mark Otto's avatar
cards  
Mark Otto committed
545
    <blockquote class="card-blockquote">
546
547
548
549
550
551
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
      <footer>
        <small>
          Someone famous in <cite title="Source Title">Source Title</cite>
        </small>
      </footer>
Mark Otto's avatar
cards  
Mark Otto committed
552
553
    </blockquote>
  </div>
554
  <div class="card card-block text-xs-center">
Mark Otto's avatar
cards  
Mark Otto committed
555
556
557
558
    <h4 class="card-title">Card title</h4>
    <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
    <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  </div>
559
  <div class="card">
Mark Otto's avatar
Mark Otto committed
560
    <img class="card-img img-fluid" data-src="holder.js/100px260/" alt="Card image">
561
  </div>
562
  <div class="card card-block text-xs-right">
Mark Otto's avatar
cards  
Mark Otto committed
563
564
    <blockquote class="card-blockquote">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
565
566
567
568
569
      <footer>
        <small class="text-muted">
          Someone famous in <cite title="Source Title">Source Title</cite>
        </small>
      </footer>
Mark Otto's avatar
cards  
Mark Otto committed
570
571
    </blockquote>
  </div>
572
  <div class="card card-block">
Mark Otto's avatar
cards  
Mark Otto committed
573
574
575
576
577
578
    <h4 class="card-title">Card title</h4>
    <p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
    <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  </div>
</div>
{% endexample %}
579
580
581
582
583
584
585
586
587
588
589
590
591

Card columns can also be extended and customized with some additional code. Shown below is an extension of the `.card-columns` class using the same CSS we use—CSS columns— to generate a set of responsive tiers for changing the number of columns.

{% highlight scss %}
.card-columns {
  @include media-breakpoint-only(lg) {
    column-count: 4;
  }
  @include media-breakpoint-only(xl) {
    column-count: 5;
  }
}
{% endhighlight %}