Check out example codes for "html center image". It will help you in understanding the concepts better.

Code Example 1

<div style="text-align: center;">
  <img scr='img/example.jpg'>
</div>

Code Example 2

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

Code Example 3

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

Code Example 4

.center {
  display: block;
  
  margin-left: auto;
  margin-right: auto;
  
  width: 50%;
}

Code Example 5

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}

Code Example 6

.centerImg {
  display: block;
  margin: 0 auto;
}

Learn ReactJs, React Native from akashmittal.com