Bootstrap Modal popping up but has a “tinted” page and can't interact

后端 未结 9 1761
南笙
南笙 2020-12-08 05:18

I am using bootstrap to set up a modal popup. When a button is clicked, the modal dialog opens, but the entire page is slightly \"tinted\", and I can\'t interact with the m

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 05:42

    This happened to me, and it took ages to diagnose. If it happens to you, add this to your css:

    div.modal div.modal-backdrop {
        z-index: 0;
    }
    

    EDIT: You may need more specificity for this setting to be picked up. As Nick Spoon suggests, you can use

    body.modal-open div.modal-backdrop { 
        z-index: 0; 
    }
    

    And you may need to add more qualifiers, depending on what the rest of your CSS is doing. You can also use !important, but that's just sweeping the problem under the rug.

提交回复
热议问题