Skip to content

Instantly share code, notes, and snippets.

@marcoskubis
Created February 13, 2017 19:30
Show Gist options
  • Save marcoskubis/7951fd7c36f95166a1b2e445b64098ea to your computer and use it in GitHub Desktop.
Save marcoskubis/7951fd7c36f95166a1b2e445b64098ea to your computer and use it in GitHub Desktop.
Bootstrap modal centralized vertically
/*
* Created by: Finik
* Copied from http://stackoverflow.com/questions/18422223/bootstrap-3-modal-vertical-position-center
*/
.modal {
text-align: center;
}
@media screen and (min-width: 768px) {
.modal:before {
display: inline-block;
vertical-align: middle;
content: " ";
height: 100%;
}
}
.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