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

Code Example 1

body {
  text-align: center;
}

Code Example 2

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

  <body>

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

</body>

Code Example 3

body {
  display:flex; flex-direction:column; justify-content:center;
  min-height:100vh;
}

Code Example 4

body {
max-width: max-content;
margin: auto;
}

Code Example 5

.class {
	text-align: center;
}

Code Example 6

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}

Learn ReactJs, React Native from akashmittal.com