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

Code Example 1

display: flex;
align-items: center;
justify-content: center;

Code Example 2

section {
  width: 200px;
  border: 1px solid #2d2d2d;
  display: flex;
  justify-content: center;
}

Learn ReactJs, React Native from akashmittal.com