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

Code Example 1

//HTML
<div class="parent">
	<span>Hello World</span>
</div>

//CSS
.parent {
  display: flex;
  justify-content: center;
  align-items: center;
}

Code Example 2

div.center{display:block;margin:auto;width:50%;}
p.center{text-align:center;}

Code Example 3

.center {
  margin: auto;
  width: 50%;
  border: 3px solid green;
  padding: 10px;
}

Code Example 4

/* this will center all children within the parent element. */
.parent {
  display: flex;
  justify-content: center; /* horizontal */
  align-items: center; /* vertical */
}

Code Example 5

<!-- 
	 Simple CSS CENTER DIV Example
 	 
	 * See Fiddle in link for PoC *
-->

<div class="parent">
  <div class="child">
    <p>
      Eh Up Me Duck!
    </p>
  </div>
</div>

<style>
.parent {
  /* Just for aesthetics: see fiddle */
  border: 1px solid black;
  padding: 2px;
}

.child {
  border: 1px solid red;
  width: 50%;
  
  /* This is where the magic happens */
  margin-left: auto;
  margin-right: auto;
  /**********************************/
}

p {
  /* As you do */
  text-align: center;
}
</style>

Code Example 6

.clearfix {
  overflow: auto;
}

Learn ReactJs, React Native from akashmittal.com