css content div center code example
Example 1: centering horizontally
div.center{display:block;margin:auto;width:50%;}
p.center{text-align:center;}
Example 2: how to align a component in the middle of page
div {
width: 100px;
height: 100px;
background-color: red;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}