繁体   English   中英

Angular - ng-bootstrap - NgbModal 弹出窗口类属性不起作用

[英]Angular - ng-bootstrap - NgbModal Popup windowClass property is not working

我有一个模态弹出窗口,我想增加它的宽度。

这是 angular 代码

openTaskDetails(content) {
const options : NgbModalOptions={
  size : 'lg',
  windowClass :'mycustomClass'
}
this.modalService.open(content ,options).result.then((result) => {
  this.saveTask(result);
}, (reason) => {
  console.log(reason);
});
}

和 css 是

.mycustomClass .modal-lg {
      width : 80% !important;
      max-width: 90% !important;
      background-color:red;
}

size 属性工作正常,但 windowClass 不是。 我试过了

.mycustomClass {
       width : 80% !important;
       max-width: 90% !important;
       background-color:red;
}

但同样的问题仍然存在,弹出的宽度没有增加。

当我检查元素时,我看到 class 名称 mycustomClass 插入到 HTML 中,但未找到 css。

请在模态 html 中插入选项,如下所示:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM