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

Code Example 1

.center {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

Code Example 2

.class {
	text-align: center;
}

Code Example 3

/*ADD MARGIN auto to left and right*/
.box1{
    width:80%;
    margin:0 auto;
}

Code Example 4

div.a {
  text-align: center;
}


    div.b {
  text-align: left;
}


    div.c {
  text-align: right;
}

div.c {
  text-align: 
    justify;
}

Code Example 5

<style>
.content {
  max-width: 500px;
  
  margin: auto;
}
</style>

  <body>

<div class="content">
  <!-- Page content -->
</div>

</body>

Learn ReactJs, React Native from akashmittal.com