嗨我有Bootstrap模态。 我没有得到垂直中心对齐的锄头?
$('#sectionAjaxLoader').modal('show');

<section class="modal" id="sectionAjaxLoader" data-keyboard="false" data-backdrop="static">
<img src='../../Images/ajax_loader.gif' alt="Please Wait..." />
</section>
&#13;
有任何想法如何实现这个?
答案 0 :(得分:0)
像这样使用
.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;
}
工作小提琴
答案 1 :(得分:0)
仅限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;
}