Search code examples
reactjsreact-bootstrap

How to change background color of react bootstrap modal


I want to change background color of react bootstrap modal popup.

my Modal code is -

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

So how to change it ?


Solution

  • If you want to update modal backdrop you could use CSS like:

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

    If you want to change modal background then use:

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

    and define in CSS:

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