How to center text vertically and horizontally inside a div


.outer {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;

display: -moz-box;
-moz-box-pack: center;
-moz-box-align: center;

display: -ms-flexbox;
-ms-flex-pack: center;
-ms-flex-align: center;

display: flex; /* probably just need here and below */
align-items: center;
justify-content: center;
}
.inner {
text-align: center;
}