Bootstrap 3 modal vertical position center
1Answer
Vertically Center
Vertically center your modals without declaring a height
.
Use this code for verticle modal in center
.modal {
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
- answered 6 years ago
- Community wiki
Your Answer