设置他父层的行高为他的高度
.modal-dialog { position: absolute; left: 50%; top: 50%; transform:translateX(-50%) translateY(-50%);}