Bootstrap 3 modal vertical position center

Discussions about Expression Media

Bootstrap 3 modal vertical position center

Postby NN636802136252247994UL » Fri Jan 25, 2019 10:14 am

This is a two part question:

How can you position the modal vertically in the center when you don't know the exact height of the modal?

Is it possible to have the modal centered and have overflow:auto in the modal-body, but only if the modal exceeds the screen height?

I have tried using this:

Code: Select all
modal-dialog {
  height: 80% !important;

.modal-content {
  height: 100% !important;

.modal-body {
  height: 80%;
  overflow: auto;

This gives me the result I need when the content is much larger than vertical screen size, but for small modal contents it's pretty much unusable.
Posts: 1
Joined: Wed Dec 12, 2018 1:13 pm

Return to Expression Media

Who is online

Users browsing this forum: No registered users and 1 guest