1 |
efrain |
1 |
---
|
|
|
2 |
layout: docs
|
|
|
3 |
title: Figures
|
|
|
4 |
description: Documentation and examples for displaying related images and text with the figure component in Bootstrap.
|
|
|
5 |
group: content
|
|
|
6 |
---
|
|
|
7 |
|
|
|
8 |
Anytime you need to display a piece of content—like an image with an optional caption, consider using a `<figure>`.
|
|
|
9 |
|
|
|
10 |
Use the included `.figure` , `.figure-img` and `.figure-caption` classes to provide some baseline styles for the HTML5 `<figure>` and `<figcaption>` elements. Images in figures have no explicit size, so be sure to add the `.img-fluid` class to your `<img>` to make it responsive.
|
|
|
11 |
|
|
|
12 |
{{< example >}}
|
|
|
13 |
<figure class="figure">
|
|
|
14 |
{{< placeholder width="400" height="300" class="figure-img img-fluid rounded" >}}
|
|
|
15 |
<figcaption class="figure-caption">A caption for the above image.</figcaption>
|
|
|
16 |
</figure>
|
|
|
17 |
{{< /example >}}
|
|
|
18 |
|
|
|
19 |
Aligning the figure's caption is easy with our [text utilities]({{< docsref "/utilities/text#text-alignment" >}}).
|
|
|
20 |
|
|
|
21 |
{{< example >}}
|
|
|
22 |
<figure class="figure">
|
|
|
23 |
{{< placeholder width="400" height="300" class="figure-img img-fluid rounded" >}}
|
|
|
24 |
<figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
|
|
|
25 |
</figure>
|
|
|
26 |
{{< /example >}}
|