首页 > 解决方案 > 如何更改反应引导模式的背景颜色

问题描述

我想更改反应引导模式弹出窗口的背景颜色。

我的模态代码是 -

<Modal
    show={this.state.show}
    onHide={this.handleClose}
    dialogClassName="modal-90w public-profile-modal-class"
    size='lg'
    aria-labelledby="example-custom-modal-styling-title"
>

那么如何改变呢?

标签: reactjsreact-bootstrap

解决方案


如果要更新模态背景,可以使用 CSS,例如:

.modal-backdrop {
  background-color: green;
}

如果要更改模态背景,请使用:

<Modal className="my-modal" show={show}>

并在 CSS 中定义:

.my-modal .modal-content {
  background-color: red;
}

推荐阅读