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

Code Example 1

/* No Flexbox */
.parent {
  position: relative;
}
.child {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* With Flexbox */

.parent {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

Code Example 2

.container{
  display: table;
}

.div-inside-container{
  display: table-cell;
  vertical-align: middle;
}

Code Example 3

.center
{

  margin: auto;

   
width: 50%;

   
border: 3px solid green;
  padding: 10px;

}

Code Example 4

.parent-class {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

Code Example 5

.center {
  display: flex;
  justify-content: center;
  
  align-items: center;
  height: 200px;
  border: 3px solid 
  green; 
}

Code Example 6

<style>
.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%);
}
</style>

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

Learn ReactJs, React Native from akashmittal.com