Twitter bootstrap 如何以垂直中心对齐的方式放置引导模式?
嗨,我有引导模式。 我没有让锄头使垂直中心对齐 $'sectionAjaxLoader'.modal'show'; 像这样使用Twitter bootstrap 如何以垂直中心对齐的方式放置引导模式?,twitter-bootstrap,vertical-alignment,bootstrap-modal,Twitter Bootstrap,Vertical Alignment,Bootstrap Modal,嗨,我有引导模式。 我没有让锄头使垂直中心对齐 $'sectionAjaxLoader'.modal'show'; 像这样使用 .modal { text-align: center; } .modal:before { display: inline-block; vertical-align: middle; content: " "; height: 100%; } .modal-dialog { display: inline-block
.modal {
text-align: center;
}
.modal:before {
display: inline-block;
vertical-align: middle;
content: " ";
height: 100%;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
工作小提琴
仅使用css
演示:,
另一个演示:要求它等待几分钟。所以我正在等待
.modal {
}
.vertical-alignment-helper {
display:table;
height: 100%;
width: 100%;
}
.vertical-align-center {
/* To center vertically */
display: table-cell;
vertical-align: middle;
}
.modal-content {
/* Bootstrap sets the size of the modal in the modal-dialog class, we need to inherit it */
width:inherit;
height:inherit;
/* To center horizontally */
margin: 0 auto;
}