2

I just read on this article that you can change bootstrap modal width with this:

.modal .modal-dialog { width: 800px; }

But when I do this, I loose the default responsiveness of the modal.

How can I change the width but keep the responsiveness on mobile?

enter image description here

Community
  • 1
  • 1
Leandro Faria
  • 445
  • 2
  • 11
  • 25

1 Answers1

6

Just use max-width. It will become responsive-

.modal .modal-dialog { width: 800px; max-width:100%; }

Or, You can do it via media queries.

@media only screen and (max-width: 480px) {
    .modal .modal-dialog {
        position:relative;
        width:auto;
        margin: 10px;
    }
}
Xahed Kamal
  • 2,203
  • 1
  • 20
  • 41