bootstrap image with text code example
Example 1: bootstrap Figures
Anytime you need to display a piece of content—like an image with an optional
caption, consider using a <figure>.
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.
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption">A caption for the above image.</figcaption>
</figure>
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
</figure>
Example 2: bootstrap card change image
.card-img-top {
width: 100%;
height: 15vw;
object-fit: cover;
}
Example 3: image on text in bootstrap
<div class="text-center">
<img src="..." class="rounded" alt="...">
</div>
Example 4: How to put text inside image in bootstrap
<div class="container">
<img src="img_snow_wide.jpg" alt="Snow"
style="width:100%;">
<div class="bottom-left">Bottom Left</div>
<div class="top-left">Top Left</div>
<div class="top-right">Top
Right</div>
<div class="bottom-right">Bottom Right</div>
<div class="centered">Centered</div>
</div>