Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of Resizing the Bootstrap Modals</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> <style> @media screen and (min-width: 676px) { .modal-dialog { max-width: 600px; /* New width for default modal */ } } </style> </head> <body> <div class="m-4"> <!-- Button HTML (to Trigger Modal) --> <a href="#defaultModal" class="btn btn-lg btn-primary" data-toggle="modal">Show Default Modal</a> <!-- Default Modal HTML --> <div id="defaultModal" class="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Default Modal</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body"> <p>The default modal size has been changed to 600px. Now it is 100px wider than the previous 500px wide modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Ok, I Understand</button> </div> </div> </div> </div> </div> </body> </html>