我想垂直居中模態。我在Google上搜索了很多,但沒有發現任何幫助。這裏是我的代碼:如何垂直居中模態?
function inactive(id, ths) {
$("#confirmation").modal("show");
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="modal fade bs-example-modal-sm" id="confirmation" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Are you sure you want to inactivate it?</h4>
</div>
<div class="modal-body">
<div class="form-group">
<input type="text" class="form-control" name="captcha" id="cval" placeholder="enter captcha">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
<button type="button" class="btn btn-primary" id="yes">Yes</button>
</div>
</div>
</div>
</div>
我怎麼能垂直居中呢?
屏幕上哪裏出現模態? – Rhono
在頂部,我的導航欄覆蓋模式。 –
onclick嘗試檢查編號 – brk