Stripped personal data from development repository
Samo Penic
2019-02-20 83c3f647c35477564b77cbc5b36d37d793d5442a
commit | author | age
83c3f6 1 ---
SP 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 {% capture example %}
13 <figure class="figure">
14   {% include icons/placeholder.svg 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 {% endcapture %}
18 {% include example.html content=example %}
19
20 Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/#text-alignment).
21
22 {% capture example %}
23 <figure class="figure">
24   {% include icons/placeholder.svg width="400" height="300" class="figure-img img-fluid rounded" %}
25   <figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
26 </figure>
27 {% endcapture %}
28 {% include example.html content=example %}