Skip to content

Instantly share code, notes, and snippets.

@nurbek-ab
Created October 31, 2016 11:27
Show Gist options
  • Save nurbek-ab/d4105ce6761fdf2293f480b04c7cd277 to your computer and use it in GitHub Desktop.
Save nurbek-ab/d4105ce6761fdf2293f480b04c7cd277 to your computer and use it in GitHub Desktop.
Bootstrap modal centered vertically via CSS only.
/*https://codepen.io/dimbslmh/full/mKfCc*/
.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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment