center div in middle of page

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


    div.b {
  text-align: left;
}


    div.c {
  text-align: right;
}

div.c {
  text-align: 
    justify;
}  
Source

Also in CSS: