I would like to center my modal on the viewport (middle) I tried to add some css properties
.modal { position: fixed; top:50%; left:50%; }
For those who are using angular-ui bootstrap can add the below classes based on above info:
Note: No other changes are needed and it shall resolve all modals.
// The 3 below classes have been placed to make the modal vertically centered
.modal-open .modal{
display:table !important;
height: 100%;
width: 100%;
pointer-events:none; /* This makes sure that we can still click outside of the modal to close it */
}
.modal-dialog{
display: table-cell;
vertical-align: middle;
pointer-events: none;
}
.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;
pointer-events: all;
}