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

Code Example 1

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

Code Example 2

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

Code Example 3

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

Code Example 4

<img src="paris.jpg" alt="Paris" class="center">

Code Example 5

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

Code Example 6

<style>
.content {
  max-width: 500px;
  
  margin: auto;
}
</style>

  <body>

<div class="content">
  <!-- Page content -->
</div>

</body>

Learn ReactJs, React Native from akashmittal.com