Check out example codes for "how to center an image element inside a block in css". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

.container {
  height: 200px;
  position: relative;
  border: 3px solid green;

.center {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);

<div class="container">
  <div class="center">
    <p>I am vertically and horizontally centered.</p>

Code Example 3

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

Learn ReactJs, React Native from