Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize the default Bootstrap modal to have a full-screen overlay?
Asked on Mar 13, 2026
Answer
To customize a Bootstrap modal to have a full-screen overlay, you can use Bootstrap's utility classes to adjust the modal's size and positioning. This involves overriding some default styles to make the modal cover the entire screen.
<!-- BEGIN COPY / PASTE -->
<div class="modal fade" id="fullscreenModal" tabindex="-1" aria-labelledby="fullscreenModalLabel" aria-hidden="true">
<div class="modal-dialog modal-fullscreen">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="fullscreenModalLabel">Full-Screen Modal</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>This is a full-screen modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Use the `modal-fullscreen` class on the `modal-dialog` to make the modal take up the full screen.
- Ensure you have Bootstrap's JavaScript included in your project to handle the modal's functionality.
- You can trigger the modal using a button with `data-bs-toggle="modal"` and `data-bs-target="#fullscreenModal"` attributes.
Recommended Links:
