我正在尝试使用 ng-bootstrap 在另一个模型之上打开模式。模型按预期打开,但第二个模型的模态背景位于第一个模型后面。
模型已打开为 document 。没有做什么特别的事情。
最佳答案
我只需添加以下 css 代码就可以完成这项工作。
.modal:nth-of-type(2) {
z-index: 1051 !important;
}
.modal-backdrop:nth-of-type(2) {
z-index: 1050 !important;
}
.modal:nth-of-type(3) {
z-index: 1052 !important;
}
.modal-backdrop:nth-of-type(3) {
z-index: 1051 !important;
}
我想打开 3 个嵌套模型。这就是为什么我添加了 nth-of-type(2) 和 nth-of-type(3)
关于javascript - Angular 2 ng-bootstrap 开启多个模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45974138/