@@ -86,7 +86,7 @@ Below is a _static_ modal example (meaning its `position` and `display` have bee
86
86
87
87
Toggle a working modal demo by clicking the button below. It will slide down and fade in from the top of the page.
88
88
89
- <div id = " exampleModalLive " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLiveLabel " aria-hidden =" true " >
89
+ <div class =" modal fade " id = " exampleModalLive " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLiveLabel " aria-hidden =" true " >
90
90
<div class =" modal-dialog " role =" document " >
91
91
<div class="modal-content">
92
92
<div class="modal-header">
@@ -144,7 +144,7 @@ Toggle a working modal demo by clicking the button below. It will slide down and
144
144
145
145
When backdrop is set to static, the modal will not close when clicking outside it. Click the button below to try it.
146
146
147
- <div id = " staticBackdropLive " class =" modal fade " data-backdrop =" static " data-keyboard =" false " tabindex =" -1 " role =" dialog " aria-labelledby =" staticBackdropLiveLabel " aria-hidden =" true " >
147
+ <div class =" modal fade " id = " staticBackdropLive " data-backdrop =" static " data-keyboard =" false " tabindex =" -1 " role =" dialog " aria-labelledby =" staticBackdropLiveLabel " aria-hidden =" true " >
148
148
<div class =" modal-dialog " role =" document " >
149
149
<div class="modal-content">
150
150
<div class="modal-header">
@@ -203,7 +203,7 @@ When backdrop is set to static, the modal will not close when clicking outside i
203
203
204
204
When modals become too long for the user's viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean.
205
205
206
- <div id = " exampleModalLong " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLongTitle " aria-hidden =" true " >
206
+ <div class =" modal fade " id = " exampleModalLong " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLongTitle " aria-hidden =" true " >
207
207
<div class =" modal-dialog " role =" document " >
208
208
<div class="modal-content">
209
209
<div class="modal-header">
@@ -246,37 +246,9 @@ When modals become too long for the user's viewport or device, they scroll indep
246
246
</button >
247
247
</div >
248
248
249
- {{< highlight html >}}
250
- <!-- Button trigger modal -->
251
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" #exampleModalLong " >
252
- Launch demo modal
253
- </button >
254
-
255
- <!-- Modal -->
256
- <div class =" modal fade " id =" exampleModalLong " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLongTitle " aria-hidden =" true " >
257
- <div class =" modal-dialog " role =" document " >
258
- <div class="modal-content">
259
- <div class="modal-header">
260
- <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
261
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
262
- <span aria-hidden="true">×</span>
263
- </button>
264
- </div>
265
- <div class="modal-body">
266
- ...
267
- </div>
268
- <div class="modal-footer">
269
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
270
- <button type="button" class="btn btn-primary">Save changes</button>
271
- </div>
272
- </div>
273
- </div >
274
- </div >
275
- {{< /highlight >}}
276
-
277
249
You can also create a scrollable modal that allows scroll the modal body by adding ` .modal-dialog-scrollable ` to ` .modal-dialog ` .
278
250
279
- <div id = " exampleModalScrollable " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalScrollableTitle " aria-hidden =" true " >
251
+ <div class =" modal fade " id = " exampleModalScrollable " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalScrollableTitle " aria-hidden =" true " >
280
252
<div class =" modal-dialog modal-dialog-scrollable " role =" document " >
281
253
<div class="modal-content">
282
254
<div class="modal-header">
@@ -320,38 +292,17 @@ You can also create a scrollable modal that allows scroll the modal body by addi
320
292
</div >
321
293
322
294
{{< highlight html >}}
323
- <!-- Button trigger modal -->
324
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" #exampleModalScrollable " >
325
- Launch demo modal
326
- </button >
327
-
328
- <!-- Modal -->
329
- <div class =" modal fade " id =" exampleModalScrollable " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalScrollableTitle " aria-hidden =" true " >
330
- <div class =" modal-dialog modal-dialog-scrollable " role =" document " >
331
- <div class="modal-content">
332
- <div class="modal-header">
333
- <h5 class="modal-title" id="exampleModalScrollableTitle">Modal title</h5>
334
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
335
- <span aria-hidden="true">×</span>
336
- </button>
337
- </div>
338
- <div class="modal-body">
339
- ...
340
- </div>
341
- <div class="modal-footer">
342
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
343
- <button type="button" class="btn btn-primary">Save changes</button>
344
- </div>
345
- </div>
346
- </div >
295
+ <!-- Scrollable modal -->
296
+ <div class =" modal-dialog modal-dialog-scrollable " role =" document " >
297
+ ...
347
298
</div >
348
299
{{< /highlight >}}
349
300
350
301
### Vertically centered
351
302
352
303
Add ` .modal-dialog-centered ` to ` .modal-dialog ` to vertically center the modal.
353
304
354
- <div id = " exampleModalCenter " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalCenterTitle " aria-hidden =" true " >
305
+ <div class =" modal fade " id = " exampleModalCenter " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalCenterTitle " aria-hidden =" true " >
355
306
<div class =" modal-dialog modal-dialog-centered " role =" document " >
356
307
<div class="modal-content">
357
308
<div class="modal-header">
@@ -371,8 +322,8 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal.
371
322
</div >
372
323
</div >
373
324
374
- <div id = " exampleModalCenteredScrollable " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalCenteredScrollableTitle " aria-hidden =" true " >
375
- <div class =" modal-dialog modal-dialog-scrollable modal-dialog-centered " role =" document " >
325
+ <div class =" modal fade " id = " exampleModalCenteredScrollable " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalCenteredScrollableTitle " aria-hidden =" true " >
326
+ <div class =" modal-dialog modal-dialog-centered modal-dialog-scrollable " role =" document " >
376
327
<div class="modal-content">
377
328
<div class="modal-header">
378
329
<h5 class="modal-title" id="exampleModalCenteredScrollableTitle">Modal title</h5>
@@ -405,38 +356,22 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal.
405
356
</div >
406
357
407
358
{{< highlight html >}}
408
- <!-- Button trigger modal -->
409
- <button type = " button " class =" btn btn-primary " data-toggle = " modal " data-target = " #exampleModalCenter " >
410
- Launch demo modal
411
- </button >
359
+ <!-- Vertically centered modal -->
360
+ <div class =" modal-dialog modal-dialog-centered " role = " document " >
361
+ ...
362
+ </div >
412
363
413
- <!-- Modal -->
414
- <div class =" modal fade " id =" exampleModalCenter " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalCenterTitle " aria-hidden =" true " >
415
- <div class =" modal-dialog modal-dialog-centered " role =" document " >
416
- <div class="modal-content">
417
- <div class="modal-header">
418
- <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
419
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
420
- <span aria-hidden="true">×</span>
421
- </button>
422
- </div>
423
- <div class="modal-body">
424
- ...
425
- </div>
426
- <div class="modal-footer">
427
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
428
- <button type="button" class="btn btn-primary">Save changes</button>
429
- </div>
430
- </div>
431
- </div >
364
+ <!-- Vertically centered scrollable modal -->
365
+ <div class =" modal-dialog modal-dialog-centered modal-dialog-scrollable " role =" document " >
366
+ ...
432
367
</div >
433
368
{{< /highlight >}}
434
369
435
370
### Tooltips and popovers
436
371
437
372
[ Tooltips] ({{< docsref "/components/tooltips" >}}) and [ popovers] ({{< docsref "/components/popovers" >}}) can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.
438
373
439
- <div id = " exampleModalPopovers " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalPopoversLabel " aria-hidden =" true " >
374
+ <div class =" modal fade " id = " exampleModalPopovers " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalPopoversLabel " aria-hidden =" true " >
440
375
<div class =" modal-dialog " role =" document " >
441
376
<div class="modal-content">
442
377
<div class="modal-header">
@@ -480,7 +415,7 @@ Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal.
480
415
481
416
Utilize the Bootstrap grid system within a modal by nesting ` .container-fluid ` within the ` .modal-body ` . Then, use the normal grid system classes as you would anywhere else.
482
417
483
- <div id = " gridSystemModal " class =" modal fade " tabindex =" -1 " role =" dialog " aria-labelledby =" gridModalLabel " aria-hidden =" true " >
418
+ <div class =" modal fade " id = " gridSystemModal " tabindex =" -1 " role =" dialog " aria-labelledby =" gridModalLabel " aria-hidden =" true " >
484
419
<div class =" modal-dialog " role =" document " >
485
420
<div class="modal-content">
486
421
<div class="modal-header">
@@ -684,51 +619,22 @@ Modals have three optional sizes, available via modifier classes to be placed on
684
619
Our default modal without modifier class constitutes the "medium" size modal.
685
620
686
621
<div class =" bd-example " >
687
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-xl " >Extra large modal</button >
688
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-lg " >Large modal</button >
689
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-sm " >Small modal</button >
622
+ <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" #exampleModalXl " >Extra large modal</button >
623
+ <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" #exampleModalLg " >Large modal</button >
624
+ <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" #exampleModalSm " >Small modal</button >
690
625
</div >
691
626
692
627
{{< highlight html >}}
693
- <!-- Extra large modal -->
694
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-xl " >Extra large modal</button >
695
-
696
- <div class =" modal fade bd-example-modal-xl " tabindex =" -1 " role =" dialog " aria-labelledby =" myExtraLargeModalLabel " aria-hidden =" true " >
697
- <div class =" modal-dialog modal-xl " role =" document " >
698
- <div class="modal-content">
699
- ...
700
- </div>
701
- </div >
702
- </div >
703
-
704
- <!-- Large modal -->
705
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-lg " >Large modal</button >
706
-
707
- <div class =" modal fade bd-example-modal-lg " tabindex =" -1 " role =" dialog " aria-labelledby =" myLargeModalLabel " aria-hidden =" true " >
708
- <div class =" modal-dialog modal-lg " role =" document " >
709
- <div class="modal-content">
710
- ...
711
- </div>
712
- </div >
713
- </div >
714
-
715
- <!-- Small modal -->
716
- <button type =" button " class =" btn btn-primary " data-toggle =" modal " data-target =" .bd-example-modal-sm " >Small modal</button >
717
-
718
- <div class =" modal fade bd-example-modal-sm " tabindex =" -1 " role =" dialog " aria-labelledby =" mySmallModalLabel " aria-hidden =" true " >
719
- <div class =" modal-dialog modal-sm " role =" document " >
720
- <div class="modal-content">
721
- ...
722
- </div>
723
- </div >
724
- </div >
628
+ <div class =" modal-dialog modal-xl " role =" document " >...</div >
629
+ <div class =" modal-dialog modal-lg " role =" document " >...</div >
630
+ <div class =" modal-dialog modal-sm " role =" document " >...</div >
725
631
{{< /highlight >}}
726
632
727
- <div class =" modal fade bd-example-modal-xl " tabindex =" -1 " role =" dialog " aria-labelledby =" myExtraLargeModalLabel " aria-hidden =" true " >
633
+ <div class =" modal fade " id = " exampleModalXl " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalXlLabel " aria-hidden =" true " >
728
634
<div class =" modal-dialog modal-xl " role =" document " >
729
635
<div class="modal-content">
730
636
<div class="modal-header">
731
- <h5 class="modal-title h4" id="myExtraLargeModalLabel ">Extra large modal</h5>
637
+ <h5 class="modal-title h4" id="exampleModalXlLabel ">Extra large modal</h5>
732
638
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
733
639
<span aria-hidden="true">×</span>
734
640
</button>
@@ -740,11 +646,11 @@ Our default modal without modifier class constitutes the "medium" size modal.
740
646
</div >
741
647
</div >
742
648
743
- <div class =" modal fade bd-example-modal-lg " tabindex =" -1 " role =" dialog " aria-labelledby =" myLargeModalLabel " aria-hidden =" true " >
649
+ <div class =" modal fade " id = " exampleModalLg " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalLgLabel " aria-hidden =" true " >
744
650
<div class =" modal-dialog modal-lg " role =" document " >
745
651
<div class="modal-content">
746
652
<div class="modal-header">
747
- <h5 class="modal-title h4" id="myLargeModalLabel ">Large modal</h5>
653
+ <h5 class="modal-title h4" id="exampleModalLgLabel ">Large modal</h5>
748
654
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
749
655
<span aria-hidden="true">×</span>
750
656
</button>
@@ -756,11 +662,11 @@ Our default modal without modifier class constitutes the "medium" size modal.
756
662
</div >
757
663
</div >
758
664
759
- <div class =" modal fade bd-example-modal-sm " tabindex =" -1 " role =" dialog " aria-labelledby =" mySmallModalLabel " aria-hidden =" true " >
665
+ <div class =" modal fade " id = " exampleModalSm " tabindex =" -1 " role =" dialog " aria-labelledby =" exampleModalSmLabel " aria-hidden =" true " >
760
666
<div class =" modal-dialog modal-sm " role =" document " >
761
667
<div class="modal-content">
762
668
<div class="modal-header">
763
- <h5 class="modal-title h4" id="mySmallModalLabel ">Small modal</h5>
669
+ <h5 class="modal-title h4" id="exampleModalSmLabel ">Small modal</h5>
764
670
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
765
671
<span aria-hidden="true">×</span>
766
672
</button>
0 commit comments