How to Create Fullscreen Modal in Bootstrap 5, 4, and 3

Last Updated on January 10, 2025 by Roshan Parihar

Learn how to create a fullscreen modal in Bootstrap 5 and other versions. The short answer is to use the class .modal-fullscreen.

However, this only works in Bootstrap 5, and other versions require some CSS to make it full screen. Let’s find out with the examples given below.

Fullscreen Modal in Bootstrap 5

To create a fullscreen modal in Bootstrap 5, you have to add the class .modal-fullscreen to the div element having class .modal-dialog is present.

Test it Live

Output

Fullscreen Modal in Bootstrap 5

When you click the button given above, you will see a full-screen modal that covers the whole page or screen.

Create Fullscreen Modal in Bootstrap 4

Bootstrap 4 does not provide any CSS for making the models full-screen. However, you can add some CSS to the div containing class .modal-dialog as given below.

Test it Live

Output

Create Fullscreen Modal in Bootstrap 4

Click the button given above to see the full screen in Bootstrap 4. It covers the entire screen with full width.

Full Screen in Bootstrap 3

Bootstrap 3 also does not have any CSS class to make the modal full-screen. It also requires adding some CSS to the div element with class .modal-dialog as given below.

Test it Live

Output

Full Screen in Bootstrap 3

You can click the button given above to see the full screen in Bootstrap 3.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.