In your code, for the modal-dialog div, add another class, modal-lg:
<div class="modal-dialog modal-lg">
Or if you wanna centre your modal dialog, use:
.modal-ku {
width: 750px;
margin: auto;
}
Answer from Praveen Kumar Purushothaman on Stack OverflowIn your code, for the modal-dialog div, add another class, modal-lg:
<div class="modal-dialog modal-lg">
Or if you wanna centre your modal dialog, use:
.modal-ku {
width: 750px;
margin: auto;
}
The easiest way can be inline style on modal-dialog div :
<div class="modal" id="myModal">
<div class="modal-dialog" style="width:1250px;">
<div class="modal-content">
...
</div>
</div>
</div>
From the docs:
Modals have two optional sizes, available via modifier classes to be placed on a .modal-dialog: modal-lg and modal-sm (as of 3.1).
Also the modal dialogue will scale itself on small screens (as of 3.1.1).
I had the same issue I have resolved by adding a media query for @screen-xs-min in less version under Modals.less
@media (max-width: @screen-xs-min) {
.modal-xs { width: @modal-sm; }
}
Pure CSS solution, using calc
.modal-body {
max-height: calc(100vh - 200px);
overflow-y: auto;
}
200px may be adjusted in accordance to height of header & footer
Similar to Bass, I had to also set the overflow-y. That could actually be done in the CSS
$('#myModal').on('show.bs.modal', function () {
$('.modal .modal-body').css('overflow-y', 'auto');
$('.modal .modal-body').css('max-height', $(window).height() * 0.7);
});
I was having the exact same problem, you can try:
.modal-body {
max-height: 800px;
}
If you notice the scroll-bars appear only on the body section of the modal dialog, this means that the max-height of only the body needs to be adjusted.
in Bootstrap 3:
.modal-dialog{
width:whatever
}
I don't have enough reputation for comment, sorry for that. I've just tested this and works fine with me just by changing .modal-dialog { width:600px; } in my main .css file. Did you close the closing brecket for the css rule as I can see you didn't here, first. Second, can you look with Inspect element or Firebug does your rule is applied to the class or div? Is it overwritten?
I found that the issue here was updating .modal.fade .modal-dialogue, rather than just .modal-dialogue. While other answers allowed for a workaround, this was the source of my particular problem.
Hopefully this helps someone in the future.
Always have handy the un-minified CSS for bootstrap so you can see what styles they have on their components, then create a CSS file AFTER it, if you don't use LESS and over-write their mixins or whatever
This is the default modal css for 768px and up:
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
...
}
They have a class modal-lg for larger widths
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
If you need something twice the 600px size, and something fluid, do something like this in your CSS after the Bootstrap css and assign that class to the modal-dialog.
@media (min-width: 768px) {
.modal-xl {
width: 90%;
max-width:1200px;
}
}
HTML
<div class="modal-dialog modal-xl">
Demo: http://jsbin.com/yefas/1
If you need this solution for only few types of modals just use
style="width:90%" attribute.
example:
div class="modal-dialog modal-lg" style="width:90%"
note: this will change only this particular modal