twitter-bootstrap Bootstrap 模态窗口是灰色的
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18580203/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap modal window is grayed out
提问by Don P
回答by adrift
It's because .navbar-fixed-tophas a z-index of 1030 while the modal backdrop has a z-index of 1040, causing the modal to overlay the navbar.
这是因为.navbar-fixed-topz-index 为 1030,而模态背景的 z-index 为 1040,导致模态覆盖导航栏。
To fix this, just adjust the .modal-backdropz-index value to be lower than 1030 - e.g.
要解决此问题,只需将.modal-backdropz-index 值调整为低于 1030 - 例如
.modal-backdrop {
z-index: 1020;
}
回答by Jossi Fresco
You can also use:
您还可以使用:
.modal-backdrop.in { z-index: auto;}
回答by Hany Gamil
First of all, add data-backdrop="false"to your modal div
首先,将data-backdrop="false" 添加到您的模态 div
Then add the following to your style:
然后将以下内容添加到您的样式中:
.modal { background: rgba(000, 000, 000, 0.8); min-height:1000000px; }
Don't forget to add the close button into your modal...
不要忘记将关闭按钮添加到您的模态中...
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
Cheers..
干杯..
回答by Alex
I had to add !important to get it working.
我必须添加 !important 才能让它工作。
.modal-backdrop {
z-index: 1020!important;
}

