Bootstrap 3.0模态打破宽度布局

时间:2013-10-10 08:45:12

标签: html css twitter-bootstrap

我在bootstrap中创建一个简单的Modal,没有修改,只是:

$('#myModal').modal({backdrop:false})

但是当模态打开时,它比浏览器更宽,无论窗口的大小是多少,并创建一个20px左右的空间。

enter image description here

为什么会发生这种情况的任何想法,我的布局都是基于Jumbotron模板,没有什么独特的,只是颜色变化。

1 个答案:

答案 0 :(得分:1)

我找到了解决此问题的其他人的答案。

body.modal-open,
.modal-open .navbar-fixed-top,
.modal-open .navbar-fixed-bottom {
  margin-right: 15px;
}

在bootstrap.css中

在主题样式表集中:

body.modal {
    margin: 0;
}

感谢您的光临。