Skip to content

Commit 7edb919

Browse files
committed
Use the example shortcode in more places
Now, it's safe to do use it since it covers more cases
1 parent 7a568f2 commit 7edb919

File tree

4 files changed

+62
-176
lines changed

4 files changed

+62
-176
lines changed

site/content/docs/4.5/components/card.md

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -352,28 +352,9 @@ Cards include a few options for working with images. Choose from appending "imag
352352

353353
Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.
354354

355-
<div class="bd-example">
356-
<div class="card mb-3">
357-
{{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
358-
<div class="card-body">
359-
<h5 class="card-title">Card title</h5>
360-
<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>
361-
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
362-
</div>
363-
</div>
364-
<div class="card">
365-
<div class="card-body">
366-
<h5 class="card-title">Card title</h5>
367-
<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>
368-
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
369-
</div>
370-
{{< placeholder width="100%" height="180" class="card-img-bottom" text="Image cap" >}}
371-
</div>
372-
</div>
373-
374-
```html
355+
{{< example >}}
375356
<div class="card mb-3">
376-
<img src="..." class="card-img-top" alt="...">
357+
{{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
377358
<div class="card-body">
378359
<h5 class="card-title">Card title</h5>
379360
<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>
@@ -386,9 +367,9 @@ Similar to headers and footers, cards can include top and bottom "image caps"—
386367
<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>
387368
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
388369
</div>
389-
<img src="..." class="card-img-bottom" alt="...">
370+
{{< placeholder width="100%" height="180" class="card-img-bottom" text="Image cap" >}}
390371
</div>
391-
```
372+
{{< /example >}}
392373

393374
### Image overlays
394375

site/content/docs/4.5/content/images.md

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ toc: true
1010

1111
Images in Bootstrap are made responsive with `.img-fluid`. `max-width: 100%;` and `height: auto;` are applied to the image so that it scales with the parent element.
1212

13-
<div class="bd-example">
14-
{{< placeholder width="100%" height="250" class="bd-placeholder-img-lg img-fluid" text="Responsive image" >}}
15-
</div>
16-
17-
```html
18-
<img src="..." class="img-fluid" alt="Responsive image">
19-
```
13+
{{< example >}}
14+
{{< placeholder width="100%" height="250" class="bd-placeholder-img-lg img-fluid" text="Responsive image" >}}
15+
{{< /example >}}
2016

2117
{{< callout warning >}}
2218
##### SVG images and Internet Explorer
@@ -28,47 +24,28 @@ In Internet Explorer 10 and 11, SVG images with `.img-fluid` are disproportionat
2824

2925
In addition to our [border-radius utilities]({{< docsref "/utilities/borders" >}}), you can use `.img-thumbnail` to give an image a rounded 1px border appearance.
3026

31-
<div class="bd-example bd-example-images">
32-
{{< placeholder width="200" height="200" class="img-thumbnail" title="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera" >}}
33-
</div>
34-
35-
```html
36-
<img src="..." alt="..." class="img-thumbnail">
37-
```
27+
{{< example >}}
28+
{{< placeholder width="200" height="200" class="img-thumbnail" title="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera" >}}
29+
{{< /example >}}
3830

3931
## Aligning images
4032

4133
Align images with the [helper float classes]({{< docsref "/utilities/float" >}}) or [text alignment classes]({{< docsref "/utilities/text#text-alignment" >}}). `block`-level images can be centered using [the `.mx-auto` margin utility class]({{< docsref "/utilities/spacing#horizontal-centering" >}}).
4234

43-
<div class="bd-example bd-example-images">
44-
{{< placeholder width="200" height="200" class="rounded float-left" >}}
45-
{{< placeholder width="200" height="200" class="rounded float-right" >}}
46-
</div>
47-
48-
```html
49-
<img src="..." class="rounded float-left" alt="...">
50-
<img src="..." class="rounded float-right" alt="...">
51-
```
52-
53-
<div class="bd-example bd-example-images">
54-
{{< placeholder width="200" height="200" class="rounded mx-auto d-block" >}}
55-
</div>
56-
57-
```html
58-
<img src="..." class="rounded mx-auto d-block" alt="...">
59-
```
35+
{{< example >}}
36+
{{< placeholder width="200" height="200" class="rounded float-left" >}}
37+
{{< placeholder width="200" height="200" class="rounded float-right" >}}
38+
{{< /example >}}
6039

61-
<div class="bd-example bd-example-images">
62-
<div class="text-center">
63-
{{< placeholder width="200" height="200" class="rounded" >}}
64-
</div>
65-
</div>
40+
{{< example >}}
41+
{{< placeholder width="200" height="200" class="rounded mx-auto d-block" >}}
42+
{{< /example >}}
6643

67-
```html
44+
{{< example >}}
6845
<div class="text-center">
69-
<img src="..." class="rounded" alt="...">
46+
{{< placeholder width="200" height="200" class="rounded" >}}
7047
</div>
71-
```
48+
{{< /example >}}
7249

7350

7451
## Picture

0 commit comments

Comments
 (0)