<div id="modal-id" class="modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-toggle="modal" data-target="modal-id" aria-label="Close"></button>
<h4 id="modal-title" class="modal-title">Title of the dialogue box</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
...
<button type="button" class="btn btn-default" data-toggle="modal" data-target="modal-id">Cancel</button>
</div>
</div>
</div>
</div>
Options
Modals with alert icons
By adding .modal-info, .modal-help, .modal-success, .modal-warning or .modal-error class to the modal wrapper .modal, it will transform the modal into a alert dialog.
By default the icon will be placed on the left, but you have the option to place it on top and align everything on center (.modal-center).
Default - icon placed on left
<div id="modal-with-alert-icons" class="modal modal-help" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
...
</div>
</div>
</div>
Centered - icon placed on center, also the text
<div id="modal-with-alert-icons" class="modal modal-center modal-help" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
...
</div>
</div>
</div>
Modal size
Modals have 5 optional sizes:
- full width (.modal-full)
- 60% of your viewport (.modal-xl)
- 720px (.modal-lg)
- 600px (default size - no additional class needed)
- 480px (.modal-sm)
Classes need to be placed on .modal-dialog.
<div id="modal-lg" class="modal" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
...
</div>
</div>
</div>