change Modal Window size

change Modal Window size

Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

I try to change the modal-dialog size to 800px with a css statement, but this did not work. The debugger show me that the css statemant

div.modal-dialog,
.modal-dialog div.modal-content {
    width: 800px !important;
}

Any Idea where i could change the width of the modal-dialog?

Andreas

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Are you using Bootstrap 3/4 or something else?

    Allan

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    BS 4

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Bootstrap is using this:

    @media (min-width: 576px)
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
    

    So you need to alter the max-width of the .modal-dialog:

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

    Searching for "change width of bootstrap 4 modal" also finds this thread among others which discusses this issue and how to resolve it.

    Allan

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    Is it possible to change the modal-dialog css class to for example modal-dialog-lg. I need the lg not in all modal windows

    Andreas

This discussion has been closed.