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

Code Example 1

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

Code Example 2

.Aligner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.Aligner-item {
  max-width: 50%;
}

.Aligner-item--top {
  align-self: flex-start;
}

.Aligner-item--bottom {
  align-self: flex-end;
}

Learn ReactJs, React Native from akashmittal.com