垂直水平居中 ie9+
.child {
position: absolute;
top: 50%; /* position the top edge of the element at the middle of the parent */
left: 50%; /* position the left edge of the element at the middle of the parent */
transform: translate(-50%, -50%); /* This is a shorthand of
translateX(-50%) and translateY(-50%) */
}
沿伸閱讀
http://stackoverflow.com/questions/8508275/how-to-center-a-position-absolute-element