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

Code Example 1

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

Learn ReactJs, React Native from akashmittal.com