Lazy Programmer

Your source for the latest in deep learning, big data, data science, and artificial intelligence. Sign up now

How to center text vertically and horizontally inside a div

February 23, 2015


.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;
}

#center #css #div #vertically align