Check out example codes for "how to horizontally center header at the top of page with flexbox css". It will help you in understanding the concepts better.

Code Example 1

.box.flex {
  display: flex;
  justify-content: center;
}

Learn ReactJs, React Native from akashmittal.com