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

Go to comments


Deep Learning and Artificial Intelligence Newsletter

Get discount coupons, free machine learning material, and new course announcements