-
If you need to change the bottom position of the modal, you need to modify the max-height of the modal-body:
.modal-body {
max-height: 75vh;
}
As other answers have said, you can adjust the right and top on the modal-dialog :
.modal-dialog {
top: 10vh;
right: 5vw;
}
- "vh" means "% of view height"
- "vw" means "% of view width"
讨论(0)
-
To change the Modal position in the viewport you can target the Modal div id, in this example this id is myModal3
<div id="modal3" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
#myModal3 {
top:5%;
right:50%;
outline: none;
overflow:hidden;
}
讨论(0)
-
I get a better result setting this class:
.modal-dialog {
position: absolute;
top: 50px;
right: 100px;
bottom: 0;
left: 0;
z-index: 10040;
overflow: auto;
overflow-y: auto;
}
With bootstrap 3.3.7.
(all credits to msnfreaky for the idea...)
讨论(0)
-
I know it's a bit late but I had issues with a modal window not allowing some links on the menu bar to work, even when it has not been triggered. But I solved it by doing the following:
.modal{
display:none;
}
讨论(0)
-
Add the following css to your html and try changing the top, right, bottom, left values.
.modal {
position: absolute;
top: 10px;
right: 100px;
bottom: 0;
left: 0;
z-index: 10040;
overflow: auto;
overflow-y: auto;
}
讨论(0)
- 热议问题