A Modal is a popup or dialog box that appears over the current page content.
How to Make a Popup Modal
This example shows how to create a basic modal popup.
Use the.fade
class to add a fading effect when opening and closing the modal:
You can resize the modal by adding .modal-sm
for a small (300px max), .modal-lg
for a large (800px max), or .modal-xl
for an extra-large (1140px max) modal. If no size is specified, the default width is 500px.
Place the size class on the <div>
that has the .modal-dialog
class
To make the modal cover the entire width and height of the page, apply the .modal-fullscreen
class
You can also set the modal to enter fullscreen mode at specific breakpoints using the .modal-fullscreen-*-*
classes
Class | Description |
---|---|
.modal-fullscreen-sm-down |
Applies fullscreen modal on screens smaller than 576px |
.modal-fullscreen-md-down |
Applies fullscreen modal on screens smaller than 768px |
.modal-fullscreen-lg-down |
Applies fullscreen modal on screens smaller than 992px |
.modal-fullscreen-xl-down |
Applies fullscreen modal on screens smaller than 1200px |
.modal-fullscreen-xxl-down |
Applies fullscreen modal on screens smaller than 1400px |
Use the .modal-dialog-centered
class to align the modal both vertically and horizontally in the center of the page.
If the modal contains a large amount of content, a scrollbar will appear on the page. Refer to the examples below for clarity.