@media screen and (min-width: 768px) { .modal-dialog { left: 50%; right: auto; width: 624px; } }
如果您想在中心设置窗口,则必须使用以下样式:
.modal-dialog{ position: absolute; left: 50%; /* now you must set a margin left under zero - value is a half width your window */ margin-left: -312px; /* this same situation is with height - example */ height: 500px; top: 50%; margin-top: -250px; }