how to align image to center in bootstrap code example

Example 1: bootstrap 4 center image

/* used mx-auto d-block */

<img class="mx-auto d-block" src="https://www.w3schools.com/bootstrap4/paris.jpg" alt="https://www.w3schools.com/bootstrap4/paris.jpg"/>

Example 2: bootstrap class align center image

class="mx-auto d-block"

Example 3: bootstrap Aligning images

Align images with the helper float classes or text alignment classes.
block-level images can be centered using the .mx-auto margin utility class.

<img src="..." class="rounded float-left" alt="...">
<img src="..." class="rounded float-right" alt="...">
<img src="..." class="rounded mx-auto d-block" alt="...">

Example 4: responsive svg with bootstrap

.svg-container { 
	display: inline-block;
	position: relative;
	width: 100%;
	padding-bottom: 100%; 
	vertical-align: middle; 
	overflow: hidden; 
}

Tags:

Html Example