xxxxxxxxxx
1
<!-- Button trigger modal -->
2
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#basicExampleModal">
3
Launch demo modal
4
</button>
5
6
<div class="big">
7
huge content
8
</div>
9
10
<!-- Modal -->
11
<div class="modal" id="basicExampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
12
aria-hidden="true">
13
<div class="modal-dialog" role="document">
14
<div class="modal-content">
15
<div class="modal-header">
16
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
17
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
18
<span aria-hidden="true">×</span>
19
</button>
20
</div>
21
<div class="modal-body">
22
...
23
</div>
24
<div class="modal-footer">
25
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
26
<button type="button" class="btn btn-primary">Save changes</button>
27
</div>
28
</div>
29
</div>
30
</div>
xxxxxxxxxx
1
.big{
2
height: 200vh;
3
width: 200vw;
4
}
5
6
.modal-content{
7
position: fixed;
8
width: 60vw;
9
height: 30vw;
10
top: 50%;
11
left: 50%;
12
transform: translate(-50%,-50%);
13
}
1
1
Console errors: 0