1

我正在使用reactStrap,如何更改模态对话的宽度,我正在尝试将其设置为 100% 宽度

我尝试使用 modal-content-custom

<Modal isOpen={true} toggle={this.toggle} dialogClassName="modal-content-custom">

使用内联样式

<Modal isOpen={true} toggle={this.toggle} dialogClassName={{maxWidth:'100%'}}>

使用自定义类

.modal-content-custom {
    max-width: 100% !important;
}

<Modal isOpen={a} toggle={this.toggle}
                className="modal-content-custom">
</Modal

但它对我不起作用,它没有覆盖 modal-dialogue 的 940px

在此处输入图像描述

4

1 回答 1

1

您可以!important在自定义中添加最大宽度className

.modal-content-custom {
  max-width: 100% !important;
}
于 2018-03-13T08:06:37.917 回答