Overlay dialog windows for important content and interactions
The simplest modal with header, body, and footer.
<div class="modal fade" id="basicModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">...</div>
<div class="modal-body">...</div>
<div class="modal-footer">...</div>
</div>
</div>
</div>
.modal
→
.modal-dialog
→
.modal-content
Bootstrap offers four modal sizes using classes on
.modal-dialog
.
.modal-sm
300px max width
(no class)
500px max width
.modal-lg
800px max width
.modal-xl
1140px max width
When content is long, modals can scroll in two ways.
By default, the entire page scrolls when modal content is long.
Add
.modal-dialog-scrollable
to scroll only the modal body.
Vertically centered with
.modal-dialog-centered
Covers entire screen with
.modal-fullscreen
Fullscreen only on mobile devices
Use modals to create an image gallery with detailed information.