Beginner
Beginner
Requires Bootstrap 5. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>A centered Bootstrap 5 modal dialog with header, body and footer actions, driven by data attributes. Free to copy or download.<button class="btn btn-primary btn-lg" data-bs-toggle="modal" data-bs-target="#demoModal">Launch demo modal</button>
<div class="modal fade" id="demoModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header"><h5 class="modal-title">Confirm subscription</h5><button class="btn-close" data-bs-dismiss="modal"></button></div>
<div class="modal-body">You're about to upgrade to the Pro plan at $12/mo. Continue?</div>
<div class="modal-footer"><button class="btn btn-light" data-bs-dismiss="modal">Cancel</button><button class="btn btn-primary">Confirm</button></div>
</div>
</div>
</div>Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.